_mjit_compile_invokebuiltin: sp_inc can be negative

Was my bad to assume sp_inc was positive.  Real criteria is the
calculated sp is non-negative.  We have to assert that.
This commit is contained in:
卜部昌平 2020-07-14 13:15:06 +09:00
parent 8900a25581
commit 8d3a084572

View File

@ -11,7 +11,7 @@
% end
rb_snum_t sp_inc = <%= insn.call_attribute('sp_inc') %>;
unsigned sp = b->stack_size + (unsigned)sp_inc;
VM_ASSERT(sp_inc >= 0);
VM_ASSERT(b->stack_size > -sp_inc);
VM_ASSERT(sp_inc < UINT_MAX - b->stack_size);
if (bf->compiler) {