summaryrefslogtreecommitdiff
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
commit66c127bc6f95761f967efc5109cd229973fbc50f (patch)
treebdf15386a6e3d19ec3198407669788ad6982da0e /thread.c
parentf3a250758d9165385061504ba1bee6b33f8cb50d (diff)
* thread.c (call_trace_proc): don't call ID2SYM() for ID_ALLOCATOR
to avoid SEGV. git-svn-id: svn+ssh://ci.ruby-lang.org/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 3591acc450..9476017a33 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));
}