summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-01 14:46:00 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-01 14:46:00 +0000
commitfc915dfff6491b3d38ed9d9219c9c6514d389096 (patch)
treef40380c42d5697df86d2b9c1159ec0475fbca552
parent2cb1e4b15092443b6049ffc7057b5f4a28a29fec (diff)
downloadruby-fc915dfff6491b3d38ed9d9219c9c6514d389096.tar.gz
ruby-fc915dfff6491b3d38ed9d9219c9c6514d389096.tar.xz
ruby-fc915dfff6491b3d38ed9d9219c9c6514d389096.zip
* eval_jump.ci (rb_f_throw): wrap tag and TAG_THROW in a NODE_MEMO
node to make throw instruction to work well. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--eval_jump.ci4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d3b742bf..6e791919b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Sep 1 23:44:26 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval_jump.ci (rb_f_throw): wrap tag and TAG_THROW in a NODE_MEMO
+ node to make throw instruction to work well.
+
Sat Sep 1 20:56:07 2007 Tanaka Akira <akr@fsij.org>
* include/ruby/ruby.h (struct RBignum): embed digits in RBignum for
diff --git a/eval_jump.ci b/eval_jump.ci
index a637f9722..1767515e6 100644
--- a/eval_jump.ci
+++ b/eval_jump.ci
@@ -39,7 +39,7 @@ rb_f_throw(int argc, VALUE *argv)
rb_raise(rb_eArgError, "uncaught throw %s", RSTRING_PTR(desc));
}
rb_trap_restore_mask();
- th->errinfo = tag;
+ th->errinfo = (VALUE)rb_node_newnode(NODE_MEMO, tag, 0, TAG_THROW);
JUMP_TAG(TAG_THROW);
#ifndef __GNUC__
@@ -117,7 +117,7 @@ rb_f_catch(int argc, VALUE *argv)
if ((state = EXEC_TAG()) == 0) {
val = rb_yield_0(1, &tag);
}
- else if (state == TAG_THROW && th->errinfo == tag) {
+ else if (state == TAG_THROW && RNODE(th->errinfo)->u1.value == tag) {
val = th->tag->retval;
th->errinfo = Qnil;
state = 0;