comparison src/syntax.c @ 5545:69de75c48efa

Alan Mackenzie's syntax cache bounds fix.
author Stephen J. Turnbull <stephen@xemacs.org>
date Mon, 08 Aug 2011 13:57:20 +0900
parents c2301b2c88c8
children 85210c453a97
comparison
equal deleted inserted replaced
5544:c2301b2c88c8 5545:69de75c48efa
290 if (BUFFERP (object)) 290 if (BUFFERP (object))
291 { 291 {
292 /* make known region zero-length and reset insertion behavior */ 292 /* make known region zero-length and reset insertion behavior */
293 Fset_marker (cache->start, make_int (1), object); 293 Fset_marker (cache->start, make_int (1), object);
294 Fset_marker (cache->end, make_int (1), object); 294 Fset_marker (cache->end, make_int (1), object);
295 Fset_marker_insertion_type (cache->start, Qt); 295 Fset_marker_insertion_type (cache->start, Qnil);
296 Fset_marker_insertion_type (cache->end, Qnil); 296 Fset_marker_insertion_type (cache->end, Qt);
297 } 297 }
298 else 298 else
299 { 299 {
300 /* invalidate the known region markers */ 300 /* invalidate the known region markers */
301 Fset_marker (cache->start, Qnil, Qnil); 301 Fset_marker (cache->start, Qnil, Qnil);
406 EXTENT_AT_AFTER, 0); 406 EXTENT_AT_AFTER, 0);
407 lim = next_previous_single_property_change (pos, Qsyntax_table, 407 lim = next_previous_single_property_change (pos, Qsyntax_table,
408 cache->object, -1, 1, 0); 408 cache->object, -1, 1, 0);
409 if (lim < 0) 409 if (lim < 0)
410 { 410 {
411 next = buffer_or_string_absolute_end_byte (cache->object); 411 next = buffer_or_string_accessible_end_byte (cache->object);
412 at_begin = 1; 412 at_begin = 1;
413 } 413 }
414 else 414 else
415 next = lim; 415 next = lim;
416 416
417 if (pos < buffer_or_string_absolute_end_byte (cache->object)) 417 if (pos < buffer_or_string_accessible_end_byte (cache->object))
418 pos = next_bytexpos (cache->object, pos); 418 pos = next_bytexpos (cache->object, pos);
419 lim = next_previous_single_property_change (pos, Qsyntax_table, 419 lim = next_previous_single_property_change (pos, Qsyntax_table,
420 cache->object, -1, 0, 0); 420 cache->object, -1, 0, 0);
421 if (lim < 0) 421 if (lim < 0)
422 { 422 {
423 prev = buffer_or_string_absolute_begin_byte (cache->object); 423 prev = buffer_or_string_accessible_begin_byte (cache->object);
424 at_end = 1; 424 at_end = 1;
425 } 425 }
426 else 426 else
427 prev = lim; 427 prev = lim;
428 428