vm.c (OP_ENTER): clear all registers region in the stack

To keep GC away from touching uninitialized values
This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-12-15 23:23:07 +09:00
parent d13e6ff8c9
commit 19385a8710
+1 -1
View File
@@ -2101,7 +2101,7 @@ RETRY_TRY_BLOCK:
/* clear local (but non-argument) variables */
mrb_int pos = m1+2; /* self+m1+blk */
if (irep->nlocals-pos > 0) {
stack_clear(&regs[pos], irep->nlocals-pos);
stack_clear(&regs[pos], irep->nregs-pos);
}
NEXT;
}