summaryrefslogtreecommitdiffhomepage
path: root/src/opcode.h
diff options
context:
space:
mode:
authordearblue <[email protected]>2021-04-03 21:20:59 +0900
committerdearblue <[email protected]>2021-04-03 21:20:59 +0900
commit4c196dcdaaf4127e2ce988fb79f1912c78b9dca8 (patch)
treeb42012971f1822b6bd1deef1e436078b45a4da85 /src/opcode.h
parentdd34ac647fb5d6842941b3529d1452797862cc23 (diff)
downloadmruby-4c196dcdaaf4127e2ce988fb79f1912c78b9dca8.tar.gz
mruby-4c196dcdaaf4127e2ce988fb79f1912c78b9dca8.zip
Reorganize `mcall()` in `mruby-method`.
Use `mrb_exec_irep()`. If possible, re-entry into the VM will be suppressed. Note that due to the effect of being a tail-call, the backtrace of `Method#call` will be lost, and it will look as if the target method was called directly. This change fixes the problem of infinite loops when redefining methods that make block calls using `mruby-method`. ```console % bin/mruby -e 'mm = method(:proc); define_method(:proc, ->(*a, &b) { mm.call(*a, &b) }); p proc { 1 }' trace (most recent call last): [257] -e:1 [256] -e:1:in proc [255] -e:1:in proc ...SNIP... [1] -e:1:in proc -e:1:in proc: stack level too deep (SystemStackError) ```
Diffstat (limited to 'src/opcode.h')
0 files changed, 0 insertions, 0 deletions