ext/ruby_prof.c in ruby-prof-0.7.8 vs ext/ruby_prof.c in ruby-prof-0.7.9
- old
+ new
@@ -1202,11 +1202,14 @@
case RUBY_EVENT_RETURN:
case RUBY_EVENT_C_RETURN:
{
frame = pop_frame(thread_data, now);
#ifdef RUBY_VM
- // we need to go up the stack to find the right one [http://redmine.ruby-lang.org/issues/show/2610] (for now)
- while( (frame->call_info->target->key->mid != mid) || (frame->call_info->target->key->klass != klass)){
+ // we need to walk up the stack to find the right one [http://redmine.ruby-lang.org/issues/show/2610] (for now)
+ // sometimes frames don't have line and source somehow [like blank]
+ // if we hit one there's not much we can do...I guess...
+ // or maybe we don't have one because we're at the top or something.
+ while( frame->call_info->target->key->mid && frame->call_info->target->key->klass && ((frame->call_info->target->key->mid != mid) || (frame->call_info->target->key->klass != klass))){
frame = pop_frame(thread_data, now);
}
#endif
break;
}