summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 9811c71d9..7ad94f1e6 100644
--- a/eval.c
+++ b/eval.c
@@ -4763,7 +4763,7 @@ return_jump(retval)
tt->retval = retval;
JUMP_TAG(TAG_RETURN);
}
- if (tt->tag == PROT_THREAD) {
+ if (tt->tag == PROT_THREAD && tt->prev) {
rb_raise(rb_eThreadError, "return can't jump across threads");
}
tt = tt->prev;