summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-09 01:39:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-09 01:39:58 +0000
commit403d2590d8c8c961b478b740ccec4746c48015da (patch)
treefaf1b12374f060e4bc6dbd0c376251ff7a2fa000 /eval.c
parent2d7f1f2b3db4a1e75514db5d9fa885d2a8cbbd7c (diff)
downloadruby-403d2590d8c8c961b478b740ccec4746c48015da.tar.gz
ruby-403d2590d8c8c961b478b740ccec4746c48015da.tar.xz
ruby-403d2590d8c8c961b478b740ccec4746c48015da.zip
* eval.c (struct tag): dst should be VALUE.
* eval.c (localjump_destination): stop at the scope where the current block was created. [ruby-dev:21353] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/eval.c b/eval.c
index a9c2dc7f7..7119596b3 100644
--- a/eval.c
+++ b/eval.c
@@ -822,7 +822,7 @@ struct tag {
VALUE tag;
VALUE retval;
struct SCOPE *scope;
- int dst;
+ VALUE dst;
struct tag *prev;
};
static struct tag *prot_tag;
@@ -1520,6 +1520,7 @@ localjump_reason(exc)
return rb_iv_get(exc, "@reason");
}
+NORETURN(static void jump_tag_but_local_jump _((int)));
static void
jump_tag_but_local_jump(state)
int state;
@@ -4023,18 +4024,16 @@ localjump_destination(state, scope, retval)
(tt->tag == PROT_CALL || tt->tag == tag) && tt->scope == scope) {
tt->dst = (VALUE)scope;
tt->retval = retval;
- break;
+ JUMP_TAG(state);
}
+ if (tt->tag == PROT_FUNC && tt->scope == scope) break;
if (tt->tag == PROT_THREAD) {
rb_raise(rb_eThreadError, "%s jump can't across threads",
(state == TAG_BREAK) ? "break" : "return");
}
tt = tt->prev;
}
- if (!tt) {
- jump_tag_but_local_jump(state);
- }
- JUMP_TAG(state);
+ jump_tag_but_local_jump(state);
}
static VALUE