Assert that non-empty LINK_ANCHOR does not loop
After any `LINK_ELEMENT` sequence is added, `LINK_ANCHOR` must not loop.
This commit is contained in:
parent
84bf0b3774
commit
319ac31529
Notes:
git
2024-11-28 07:51:28 +00:00
@ -1290,10 +1290,15 @@ static void
|
||||
APPEND_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *const anc1, LINK_ANCHOR *const anc2)
|
||||
{
|
||||
if (anc2->anchor.next) {
|
||||
/* LINK_ANCHOR must not loop */
|
||||
RUBY_ASSERT(anc2->last != &anc2->anchor);
|
||||
anc1->last->next = anc2->anchor.next;
|
||||
anc2->anchor.next->prev = anc1->last;
|
||||
anc1->last = anc2->last;
|
||||
}
|
||||
else {
|
||||
RUBY_ASSERT(anc2->last == &anc2->anchor);
|
||||
}
|
||||
verify_list("append", anc1);
|
||||
}
|
||||
#if CPDEBUG < 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user