summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-05 03:36:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-05 03:36:46 +0000
commitc41d275f6bd7bf450e947d0e6fd3d2fae86b0d15 (patch)
tree0f49b1fd5ae7585c39493bbd97dcbc0528f34ec5 /eval.c
parent07c0823543305e59ed45f29bed8c4789ceb3001d (diff)
* eval.c (rb_eval): not discard fatal error.
* eval.c (rb_longjmp): reset raised flag before fatal error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index 36d12d5058..a7f732becc 100644
--- a/eval.c
+++ b/eval.c
@@ -1291,10 +1291,12 @@ error_print()
if (EXEC_TAG()) goto error;
if (NIL_P(errat)){
ruby_set_current_source();
- if (ruby_sourcefile)
- warn_printf("%s:%d", ruby_sourcefile, ruby_sourceline);
- else
+ if (!ruby_sourcefile)
warn_printf("%d", ruby_sourceline);
+ else if (!ruby_sourceline)
+ warn_printf("%s", ruby_sourcefile);
+ else
+ warn_printf("%s:%d", ruby_sourcefile, ruby_sourceline);
}
else if (RARRAY(errat)->len == 0) {
error_pos();
@@ -3411,8 +3413,11 @@ rb_eval(self, n)
result = prot_tag->retval;
}
POP_TAG();
- if (state != TAG_RAISE) ruby_errinfo = e_info;
- if (state) {
+ switch (state) {
+ case 0: break;
+ default:
+ ruby_errinfo = e_info;
+ case TAG_RAISE: case TAG_FATAL:
JUMP_TAG(state);
}
/* no exception raised */
@@ -4658,6 +4663,7 @@ rb_longjmp(tag, mesg)
if (rb_thread_set_raised(th)) {
ruby_errinfo = exception_error;
+ rb_thread_reset_raised(th);
JUMP_TAG(TAG_FATAL);
}
if (NIL_P(mesg)) mesg = ruby_errinfo;