summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-11-28 15:13:52 +0900
committerNobuyoshi Nakada <[email protected]>2024-11-28 15:13:52 +0900
commit319ac31529eb7bf7e5a4ef582c6f930bd8fca62e ()
tree9482c3c67f7ad579329c25bedeea64975e63df94 /compile.c
parent84bf0b37741fadd88c8ce8591e77476880dd209a (diff)
Assert that non-empty LINK_ANCHOR does not loop
After any `LINK_ELEMENT` sequence is added, `LINK_ANCHOR` must not loop.
Notes: Merged: https://.com/ruby/ruby/pull/12195
-rw-r--r--compile.c5
1 files changed, 5 insertions, 0 deletions
@@ -1290,10 +1290,15 @@ static void
APPEND_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *const anc1, LINK_ANCHOR *const anc2)
{
if (anc2->anchor.next) {
anc1->last->next = anc2->anchor.next;
anc2->anchor.next->prev = anc1->last;
anc1->last = anc2->last;
}
verify_list("append", anc1);
}
#if CPDEBUG < 0