From de64e17f662930452708c4ab104491cf097f6b09 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 19 Apr 2016 04:46:20 +0000 Subject: 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 --- error.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'error.c') 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 -- cgit v1.2.3