Use adjusted sp on iseq_set_sequence()

This commit is contained in:
wanabe 2020-08-07 07:59:50 +09:00
parent 5dc107b03f
commit 3685ed7303
Notes: git 2020-10-31 09:19:01 +09:00

View File

@ -2271,15 +2271,13 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
case ISEQ_ELEMENT_ADJUST: case ISEQ_ELEMENT_ADJUST:
{ {
ADJUST *adjust = (ADJUST *)list; ADJUST *adjust = (ADJUST *)list;
if (adjust->line_no != -1) {
int orig_sp = sp; int orig_sp = sp;
sp = adjust->label ? adjust->label->sp : 0; sp = adjust->label ? adjust->label->sp : 0;
if (orig_sp - sp > 0) { if (adjust->line_no != -1 && orig_sp - sp > 0) {
if (orig_sp - sp > 1) code_index++; /* 1 operand */ if (orig_sp - sp > 1) code_index++; /* 1 operand */
code_index++; /* insn */ code_index++; /* insn */
insn_num++; insn_num++;
} }
}
break; break;
} }
default: break; default: break;