mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Guard against implicitly forwarded block
This commit is contained in:
parent
ecd4487a48
commit
0fb2926097
1 changed files with 14 additions and 0 deletions
|
@ -2967,6 +2967,20 @@ gen_invokesuper(jitstate_t *jit, ctx_t *ctx)
|
||||||
// Guard that the receiver has the same class as the one from compile time
|
// Guard that the receiver has the same class as the one from compile time
|
||||||
uint8_t *side_exit = yjit_side_exit(jit, ctx);
|
uint8_t *side_exit = yjit_side_exit(jit, ctx);
|
||||||
|
|
||||||
|
if (!block) {
|
||||||
|
// Guard no block passed
|
||||||
|
// rb_vm_frame_block_handler(GET_EC()->cfp) == VM_BLOCK_HANDLER_NONE
|
||||||
|
// note, we assume VM_ASSERT(VM_ENV_LOCAL_P(ep))
|
||||||
|
//
|
||||||
|
// TODO: this could properly forward the current block handler, but
|
||||||
|
// would require changes to gen_send_*
|
||||||
|
ADD_COMMENT(cb, "guard no block given");
|
||||||
|
mov(cb, REG0, member_opnd(REG_CFP, rb_control_frame_t, ep));
|
||||||
|
mov(cb, REG0, mem_opnd(64, REG0, SIZEOF_VALUE * VM_ENV_DATA_INDEX_SPECVAL));
|
||||||
|
cmp(cb, REG0, imm_opnd(VM_BLOCK_HANDLER_NONE));
|
||||||
|
jne_ptr(cb, side_exit);
|
||||||
|
}
|
||||||
|
|
||||||
// Points to the receiver operand on the stack
|
// Points to the receiver operand on the stack
|
||||||
x86opnd_t recv = ctx_stack_opnd(ctx, argc);
|
x86opnd_t recv = ctx_stack_opnd(ctx, argc);
|
||||||
insn_opnd_t recv_opnd = OPND_STACK(argc);
|
insn_opnd_t recv_opnd = OPND_STACK(argc);
|
||||||
|
|
Loading…
Add table
Reference in a new issue