_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:
parent
8900a25581
commit
8d3a084572
@ -11,7 +11,7 @@
|
|||||||
% end
|
% end
|
||||||
rb_snum_t sp_inc = <%= insn.call_attribute('sp_inc') %>;
|
rb_snum_t sp_inc = <%= insn.call_attribute('sp_inc') %>;
|
||||||
unsigned sp = b->stack_size + (unsigned)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);
|
VM_ASSERT(sp_inc < UINT_MAX - b->stack_size);
|
||||||
|
|
||||||
if (bf->compiler) {
|
if (bf->compiler) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user