summaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-10 08:33:28 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-10 08:33:28 +0000
commitc216c3e03f684ce5d1f9b5b1bed70df0d89e78cb (patch)
treebdf15386a6e3d19ec3198407669788ad6982da0e /thread.c
parent6cf747f67d577c4ed98201e18b5c3c41738bef15 (diff)
downloadruby-c216c3e03f684ce5d1f9b5b1bed70df0d89e78cb.tar.gz
ruby-c216c3e03f684ce5d1f9b5b1bed70df0d89e78cb.tar.xz
ruby-c216c3e03f684ce5d1f9b5b1bed70df0d89e78cb.zip
* thread.c (call_trace_proc): don't call ID2SYM() for ID_ALLOCATOR
to avoid SEGV. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index 3591acc45..9476017a3 100644
--- a/thread.c
+++ b/thread.c
@@ -2890,10 +2890,20 @@ call_trace_proc(VALUE args)
VALUE eventname = rb_str_new2(get_event_name(p->event));
VALUE filename = rb_str_new2(rb_sourcefile());
int line = rb_sourceline();
+ VALUE mid;
+ if (p->id == ID_ALLOCATOR) {
+ mid = ID2SYM(rb_intern("allocate"));
+ }
+ else if (p->id) {
+ mid = ID2SYM(p->id);
+ }
+ else {
+ mid = Qnil;
+ }
return rb_proc_call(p->proc, rb_ary_new3(6,
eventname, filename, INT2FIX(line),
- p->id ? ID2SYM(p->id) : Qnil,
+ mid,
p->self ? rb_binding_new() : Qnil,
p->klass ? p->klass : Qnil));
}