aboutsummaryrefslogtreecommitdiffstats
path: root/error.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-19 04:46:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-19 04:46:20 +0000
commitde64e17f662930452708c4ab104491cf097f6b09 (patch)
tree75d40fb1d4db375f4b4a3ed256ed40674b28195b /error.c
parent5b561fb37ebb37374b27e4b6f1eba0c5f26b5733 (diff)
downloadruby-de64e17f662930452708c4ab104491cf097f6b09.tar.gz
appending compile error without rb_errinfo
* compile.c (append_compile_error, compile_bug): pass iseq and get error info and file from it, not by the thread error info. * error.c (rb_report_bug_valist): take va_list instead of variadic arguments, and just report the bug but not abort. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r--error.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/error.c b/error.c
index 4e35fb9c9c..36a1bf5da7 100644
--- a/error.c
+++ b/error.c
@@ -308,7 +308,7 @@ bug_report_file(const char *file, int line)
}
static void
-bug_report_begin(FILE *out, const char *fmt, va_list args)
+bug_report_begin_valist(FILE *out, const char *fmt, va_list args)
{
char buf[REPORT_BUG_BUFSIZ];
@@ -322,7 +322,7 @@ bug_report_begin(FILE *out, const char *fmt, va_list args)
#define bug_report_begin(out, fmt) do { \
va_list args; \
va_start(args, fmt); \
- bug_report_begin(out, fmt, args); \
+ bug_report_begin_valist(out, fmt, args); \
va_end(args); \
} while (0)
@@ -349,6 +349,15 @@ bug_report_end(FILE *out)
} \
} while (0) \
+#define report_bug_valist(file, line, fmt, ctx, args) do { \
+ FILE *out = bug_report_file(file, line); \
+ if (out) { \
+ bug_report_begin_valist(out, fmt, args); \
+ rb_vm_bugreport(ctx); \
+ bug_report_end(out); \
+ } \
+} while (0) \
+
NORETURN(static void die(void));
static void
die(void)
@@ -437,11 +446,9 @@ rb_async_bug_errno(const char *mesg, int errno_arg)
}
void
-rb_compile_bug_str(VALUE file, int line, const char *fmt, ...)
+rb_report_bug_valist(VALUE file, int line, const char *fmt, va_list args)
{
- report_bug(RSTRING_PTR(file), line, fmt, NULL);
-
- abort();
+ report_bug_valist(RSTRING_PTR(file), line, fmt, NULL, args);
}
void