diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-25 14:46:36 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-25 14:46:36 +0000 |
commit | 5a1fa79086c4f1c6e11a78d5d0ff8d58cc3e238a (patch) | |
tree | 16868615fbbb66d0a1c9a51be19281a7f6e4a982 /vm.c | |
parent | 3a724e086af6a6a8846da1f194cfb12c1977573b (diff) |
merges r24530 from trunk into ruby_1_9_1.
--
* vm.c (vm_exec): returning from lambda runs ensure section.
[Bug #1729]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@25480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -1114,10 +1114,23 @@ vm_exec(rb_thread_t *th) SET_THROWOBJ_STATE(err, state = TAG_BREAK); } else { - result = GET_THROWOBJ_VAL(err); - th->errinfo = Qnil; - th->cfp += 2; - goto finish_vme; + for (i = 0; i < cfp->iseq->catch_table_size; i++) { + entry = &cfp->iseq->catch_table[i]; + if (entry->start < epc && entry->end >= epc) { + if (entry->type == CATCH_TYPE_ENSURE) { + catch_iseqval = entry->iseq; + cont_pc = entry->cont; + cont_sp = entry->sp; + break; + } + } + } + if (!catch_iseqval) { + result = GET_THROWOBJ_VAL(err); + th->errinfo = Qnil; + th->cfp += 2; + goto finish_vme; + } } /* through */ } |