summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--eval.c1
-rw-r--r--eval_error.c8
3 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 2ee3d4c9bc..738b45a2a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Aug 5 12:39:23 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (rb_longjmp): reset raised flag before fatal error.
+
Wed Aug 5 10:20:39 2009 NARUSE, Yui <naruse@ruby-lang.org>
* re.c (rb_reg_preprocess_dregexp): add options to arguments.
diff --git a/eval.c b/eval.c
index f2bcbf3b56..f1589e25f3 100644
--- a/eval.c
+++ b/eval.c
@@ -345,6 +345,7 @@ rb_longjmp(int tag, volatile VALUE mesg)
if (rb_threadptr_set_raised(th)) {
th->errinfo = exception_error;
+ rb_threadptr_reset_raised(th);
JUMP_TAG(TAG_FATAL);
}
diff --git a/eval_error.c b/eval_error.c
index 85e55ad3c8..809a66feab 100644
--- a/eval_error.c
+++ b/eval_error.c
@@ -87,10 +87,12 @@ error_print(void)
if (NIL_P(errat)) {
const char *file = rb_sourcefile();
int line = rb_sourceline();
- if (file)
- warn_printf("%s:%d", file, line);
- else
+ if (!file)
warn_printf("%d", line);
+ else if (!line)
+ warn_printf("%s", file, line);
+ else
+ warn_printf("%s:%d", file, line);
}
else if (RARRAY_LEN(errat) == 0) {
error_pos();