Project

General

Profile

Bug #4379 » eval_location.patch

quix (James M. Lawrence), 02/08/2011 03:19 AM

View differences:

vm_eval.c
rb_block_t block;
volatile int parse_in_eval;
volatile int mild_compile_error;
volatile int is_user_file = FALSE;
if (file == 0) {
file = rb_sourcefile();
line = rb_sourceline();
} else {
is_user_file = 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 (!is_user_file && 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 (!is_user_file && strcmp(file, "(eval)") == 0) {
VALUE mesg, errat, bt2;
extern VALUE rb_get_backtrace(VALUE info);
ID id_mesg;
(2-2/4)