diff options
| author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-15 16:45:41 +0000 |
|---|---|---|
| committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-15 16:45:41 +0000 |
| commit | 2e6091e8baf26b80651f5b2e410f3d36363cb013 (patch) | |
| tree | 024e1ce5a42e70905464340e7cc65b59e24d9841 /thread.c | |
| parent | e17e71c37f8cf5fef8ff56d354c7f81357a6dce1 (diff) | |
| download | ruby-2e6091e8baf26b80651f5b2e410f3d36363cb013.tar.gz ruby-2e6091e8baf26b80651f5b2e410f3d36363cb013.tar.xz ruby-2e6091e8baf26b80651f5b2e410f3d36363cb013.zip | |
* thread.c (call_trace_proc): as Matz said ([ruby-core:21183]),
should skip rb_str_new2() if rb_sourcefile() returns NULL.
rb_sourcefile() returns NULL if frame is toplevel of Fiber.
[ruby-core:21161] [Bug #985]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
| -rw-r--r-- | thread.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -3624,8 +3624,9 @@ static VALUE call_trace_proc(VALUE args, int tracing) { struct call_trace_func_args *p = (struct call_trace_func_args *)args; + const char *srcfile = rb_sourcefile(); VALUE eventname = rb_str_new2(get_event_name(p->event)); - VALUE filename = rb_str_new2(rb_sourcefile()); + VALUE filename = srcfile ? rb_str_new2(srcfile) : Qnil; VALUE argv[6]; int line = rb_sourceline(); ID id = 0; @@ -3654,7 +3655,7 @@ call_trace_proc(VALUE args, int tracing) argv[1] = filename; argv[2] = INT2FIX(line); argv[3] = id ? ID2SYM(id) : Qnil; - argv[4] = p->self ? rb_binding_new() : Qnil; + argv[4] = (p->self && srcfile) ? rb_binding_new() : Qnil; argv[5] = klass ? klass : Qnil; return rb_proc_call_with_block(p->proc, 6, argv, Qnil); |
