@@ -3825,6 +3825,7 @@ pm_compile_defined_expr0(rb_iseq_t *iseq, const pm_node_t *node, const pm_node_l
3825
3825
case PM_YIELD_NODE :
3826
3826
PUSH_INSN (ret , location , putnil );
3827
3827
PUSH_INSN3 (ret , location , defined , INT2FIX (DEFINED_YIELD ), 0 , PUSH_VAL (DEFINED_YIELD ));
3828
+ iseq_set_use_block (ISEQ_BODY (iseq )-> local_iseq );
3828
3829
return ;
3829
3830
case PM_SUPER_NODE :
3830
3831
case PM_FORWARDING_SUPER_NODE :
@@ -6962,6 +6963,9 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
6962
6963
6963
6964
PUSH_LABEL (ret , retry_label );
6964
6965
}
6966
+ else {
6967
+ iseq_set_use_block (ISEQ_BODY (iseq )-> local_iseq );
6968
+ }
6965
6969
6966
6970
PUSH_INSN (ret , location , putself );
6967
6971
int flag = VM_CALL_ZSUPER | VM_CALL_SUPER | VM_CALL_FCALL ;
@@ -8994,6 +8998,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
8994
8998
if (parameters_node -> block ) {
8995
8999
body -> param .block_start = local_index ;
8996
9000
body -> param .flags .has_block = true;
9001
+ iseq_set_use_block (iseq );
8997
9002
8998
9003
pm_constant_id_t name = ((const pm_block_parameter_node_t * ) parameters_node -> block )-> name ;
8999
9004
@@ -9549,6 +9554,10 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
9549
9554
pm_scope_node_destroy (& next_scope_node );
9550
9555
}
9551
9556
9557
+ if (!cast -> block ) {
9558
+ iseq_set_use_block (ISEQ_BODY (iseq )-> local_iseq );
9559
+ }
9560
+
9552
9561
if ((flags & VM_CALL_ARGS_BLOCKARG ) && (flags & VM_CALL_KW_SPLAT ) && !(flags & VM_CALL_KW_SPLAT_MUT )) {
9553
9562
PUSH_INSN (args , location , splatkw );
9554
9563
}
@@ -9681,6 +9690,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
9681
9690
}
9682
9691
9683
9692
PUSH_INSN1 (ret , location , invokeblock , new_callinfo (iseq , 0 , argc , flags , keywords , FALSE));
9693
+ iseq_set_use_block (ISEQ_BODY (iseq )-> local_iseq );
9684
9694
if (popped ) PUSH_INSN (ret , location , pop );
9685
9695
9686
9696
int level = 0 ;
0 commit comments