diff options
author | Koichi Sasada <[email protected]> | 2024-04-17 16:30:47 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2024-04-17 17:03:46 +0900 |
commit | f9f301800199e7b5b9a6e92cf726cd0214d417a4 (patch) | |
tree | 0767b9536a638f7e8a961f3f0d54c171c3065cad /compile.c | |
parent | 0b630d644128da611c73fd9fc28d3ee2e9cd80c0 (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.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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) { |