compile.c: dump iseq
* compile.c (append_compile_error): raise a fatal error when compile_debug is enabled. * compile.c (COMPILE_ERROR): dump the disassembled instruction instruction sequence always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3bf4c46bb8
commit
703675da95
16
compile.c
16
compile.c
@ -321,7 +321,9 @@ struct iseq_compile_data_ensure_node_stack {
|
|||||||
#define IS_INSN_ID(iobj, insn) (INSN_OF(iobj) == BIN(insn))
|
#define IS_INSN_ID(iobj, insn) (INSN_OF(iobj) == BIN(insn))
|
||||||
|
|
||||||
/* error */
|
/* error */
|
||||||
typedef void (*compile_error_func)(rb_iseq_t *, int, const char *, ...);
|
#if CPDEBUG > 0
|
||||||
|
NORETURN(static void append_compile_error(rb_iseq_t *iseq, int line, const char *fmt, ...));
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
append_compile_error(rb_iseq_t *iseq, int line, const char *fmt, ...)
|
append_compile_error(rb_iseq_t *iseq, int line, const char *fmt, ...)
|
||||||
@ -341,6 +343,7 @@ append_compile_error(rb_iseq_t *iseq, int line, const char *fmt, ...)
|
|||||||
else if (!err_info) {
|
else if (!err_info) {
|
||||||
RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->err_info, Qtrue);
|
RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->err_info, Qtrue);
|
||||||
}
|
}
|
||||||
|
if (compile_debug) rb_exc_fatal(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -353,16 +356,7 @@ compile_bug(rb_iseq_t *iseq, int line, const char *fmt, ...)
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
NOINLINE(static compile_error_func prepare_compile_error(rb_iseq_t *iseq));
|
#define COMPILE_ERROR append_compile_error
|
||||||
|
|
||||||
static compile_error_func
|
|
||||||
prepare_compile_error(rb_iseq_t *iseq)
|
|
||||||
{
|
|
||||||
if (compile_debug) return &compile_bug;
|
|
||||||
return &append_compile_error;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define COMPILE_ERROR prepare_compile_error(iseq)
|
|
||||||
|
|
||||||
#define ERROR_ARGS_AT(n) iseq, nd_line(n),
|
#define ERROR_ARGS_AT(n) iseq, nd_line(n),
|
||||||
#define ERROR_ARGS ERROR_ARGS_AT(node)
|
#define ERROR_ARGS ERROR_ARGS_AT(node)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user