Permalink
Browse files

don't symbolize the null id

  • Loading branch information...
1 parent c9b422b commit c7253ba5000dc4d6843c30b44c7801ba6c36325d @ericpromislow ericpromislow committed Apr 23, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 ext/ruby_debug/193/ruby_debug.c
@@ -1755,6 +1755,7 @@ context_frame_id(int argc, VALUE *argv, VALUE self)
{
ID id;
VALUE frame;
+ VALUE frame_id;
debug_context_t *debug_context;
rb_control_frame_t *cfp;
@@ -1764,10 +1765,11 @@ context_frame_id(int argc, VALUE *argv, VALUE self)
cfp = GET_FRAME->info.runtime.cfp;
#if defined HAVE_RB_CONTROL_FRAME_T_METHOD_ID
- return(RUBYVM_CFUNC_FRAME_P(cfp) ? ID2SYM(cfp->method_id) : ID2SYM(cfp->iseq->defined_method_id));
+ frame_id = RUBYVM_CFUNC_FRAME_P(cfp) ? cfp->method_id : cfp->iseq->defined_method_id;
#elif defined HAVE_RB_METHOD_ENTRY_T_CALLED_ID
- return(RUBYVM_CFUNC_FRAME_P(cfp) ? ID2SYM(cfp->me->called_id) : ID2SYM(cfp->iseq->defined_method_id));
+ frame_id = RUBYVM_CFUNC_FRAME_P(cfp) ? cfp->me->called_id : cfp->iseq->defined_method_id;
#endif
+ return frame_id ? ID2SYM(frame_id) : Qnil;
}
/*

0 comments on commit c7253ba

Please sign in to comment.