mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Ignore partial words when creating ambiguous roots (bug#79598)
* src/igc.c (word_aligned): New function. (root_create_ambig): Cover only complete words.
This commit is contained in:
parent
5787a817a6
commit
1fab3ccc3c
1 changed files with 11 additions and 0 deletions
11
src/igc.c
11
src/igc.c
|
|
@ -2925,10 +2925,21 @@ root_create (struct igc *gc, void *start, void *end, mps_rank_t rank,
|
|||
return register_root (gc, root, start, end, ambig, label);
|
||||
}
|
||||
|
||||
static bool
|
||||
word_aligned (void *ptr)
|
||||
{
|
||||
return ((intptr_t)ptr & (sizeof (void *) - 1)) == 0;
|
||||
}
|
||||
|
||||
static igc_root_list *
|
||||
root_create_ambig (struct igc *gc, void *start, void *end,
|
||||
const char *label)
|
||||
{
|
||||
/* Partial words cannot contain ambiguous references. Ignore them. */
|
||||
while (!word_aligned (end))
|
||||
end = (char *) end - 1;
|
||||
igc_assert (word_aligned (start));
|
||||
igc_assert (start < end);
|
||||
return root_create (gc, start, end, mps_rank_ambig (), scan_ambig, NULL,
|
||||
true, label);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue