Bug #233
Block level with binding
| Status: | Closed | Start date: | ||
|---|---|---|---|---|
| Priority: | Low | Due date: | ||
| Assignee: | % Done: | 100% |
||
| Category: | - | |||
| Target version: | 1.9.2 | |||
| ruby -v: |
Description
ささだです.
b = binding
10.times{
eval('', b)
}
eval('1.times{raise}', b)
こんなプログラムで
../trunk/test.rb:5:in `eval': (eval):1:in `block (12 levels) in
<main>': (RuntimeError)
こんなふうに,block level が上がってしまいます(12 levels).
原因は Binding の持ち方の問題なんですが,ぱっと解決策が思いつかな
いため,記録だけしておきます.issue の priority を下げる方法ってウェ
ブ経由でしたっけ.
--
// SASADA Koichi at atdot dot net
Associated revisions
* vm.c (Init_VM): create and define TOPLEVEL_BINDING at first.
* vm.c (vm_set_main_stack, rb_iseq_eval_main): added.
* parse.y (rb_parser_compile_file): fix to check parse_in_eval flag.
* eval.c (ruby_exec_node): use rb_iseq_eval_main()
instead of rb_iseq_eval().
* iseq.c (rb_iseq_new_main), vm_core.h: added.
main script (specified by -e or script name) should be run
under TOPLEVEL_BINDING using Kernel#eval. Above changes
simulate Kernel#eval behaviour. [ruby-dev:37240]
* compile.c (make_name_for_block): skip iseq except block type.
this fix is needed for [ruby-dev:37240], and also fixes
[ruby-dev:35392].
History
Updated by ko1 (Koichi Sasada) almost 4 years ago
- Assignee set to ko1 (Koichi Sasada)
Updated by yugui (Yuki Sonoda) over 3 years ago
- Target version set to 1.9.1 Release Candidate
Updated by yugui (Yuki Sonoda) over 3 years ago
- Target version changed from 1.9.1 Release Candidate to 1.9.2
Updated by ko1 (Koichi Sasada) over 3 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset r21079.