Project

General

Profile

Bug #4379 » better_eval_location.patch

Slightly nicer version of eval_location.patch - quix (James M. Lawrence), 02/08/2011 05:23 AM

View differences:

vm_eval.c
rb_block_t block;
volatile int parse_in_eval;
volatile int mild_compile_error;
volatile int has_empty_file_arg = FALSE;
if (file == 0) {
file = rb_sourcefile();
line = rb_sourceline();
has_empty_file_arg = TRUE;
}
parse_in_eval = th->parse_in_eval;
......
if (rb_obj_is_kind_of(scope, rb_cBinding)) {
GetBindingPtr(scope, bind);
envval = bind->env;
if (strcmp(file, "(eval)") == 0 && bind->filename != Qnil) {
if (has_empty_file_arg && strcmp(file, "(eval)") == 0 && bind->filename != Qnil) {
file = RSTRING_PTR(bind->filename);
line = bind->line_no;
}
......
if (state) {
if (state == TAG_RAISE) {
VALUE errinfo = th->errinfo;
if (strcmp(file, "(eval)") == 0) {
if (has_empty_file_arg && strcmp(file, "(eval)") == 0) {
VALUE mesg, errat, bt2;
extern VALUE rb_get_backtrace(VALUE info);
ID id_mesg;
(3-3/4)