summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-25 14:46:36 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-25 14:46:36 +0000
commit51d5fb54472dcfa3b74a9420e5393544103f5116 (patch)
tree16868615fbbb66d0a1c9a51be19281a7f6e4a982
parent33b5b4da890ca17ef45f94edaf5610363e57ad2c (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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@25480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--version.h2
-rw-r--r--vm.c21
3 files changed, 23 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index d691f1b80..3d38c6cc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Aug 13 21:01:03 2009 wanabe <s.wanabe@gmail.com>
+
+ * vm.c (vm_exec): returning from lambda runs ensure section.
+ [Bug #1729]
+
Wed Aug 12 15:52:04 2009 NARUSE, Yui <naruse@ruby-lang.org>
* class.c (rb_define_module_id_under): fix the name.
diff --git a/version.h b/version.h
index 84ea39245..6949bb542 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.1"
-#define RUBY_PATCHLEVEL 286
+#define RUBY_PATCHLEVEL 287
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1
diff --git a/vm.c b/vm.c
index c39048b49..3efab55f8 100644
--- a/vm.c
+++ b/vm.c
@@ -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 */
}