diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-19 04:46:20 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-19 04:46:20 +0000 |
commit | 51612505f722e1e7d801e42c6bb5af6766bd874b (patch) | |
tree | 75d40fb1d4db375f4b4a3ed256ed40674b28195b /error.c | |
parent | 64231b49ca957b2a6810673e1f2abc3f63d11f29 (diff) |
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.c | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -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 |