summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorKoichi Sasada <[email protected]>2024-04-17 16:30:47 +0900
committerKoichi Sasada <[email protected]>2024-04-17 17:03:46 +0900
commitf9f301800199e7b5b9a6e92cf726cd0214d417a4 (patch)
tree0767b9536a638f7e8a961f3f0d54c171c3065cad /compile.c
parent0b630d644128da611c73fd9fc28d3ee2e9cd80c0 (diff)
`ISeq#to_a` respects `use_block` status
```ruby b = RubyVM::InstructionSequence.compile('def f = yield; def g = nil').to_a pp b #=> ... {:use_block=>true}, ... ```
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index cd63e4ba50..b980d6a32c 100644
--- a/compile.c
+++ b/compile.c
@@ -11761,6 +11761,10 @@ rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc, VALUE locals, VALUE params,
ISEQ_BODY(iseq)->param.flags.ambiguous_param0 = TRUE;
}
+ if (Qtrue == rb_hash_aref(params, SYM(use_block))) {
+ ISEQ_BODY(iseq)->param.flags.use_block = TRUE;
+ }
+
if (int_param(&i, params, SYM(kwrest))) {
struct rb_iseq_param_keyword *keyword = (struct rb_iseq_param_keyword *)ISEQ_BODY(iseq)->param.keyword;
if (keyword == NULL) {