Skip to content

Commit

Permalink
fix segfault on block calls (http://youtrack.jetbrains.net/issue/RUBY…
Browse files Browse the repository at this point in the history
  • Loading branch information
denofevil committed Mar 24, 2011
1 parent cd6f940 commit 9fb5941
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/ruby_debug/ruby_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <insns_info.inc>
#include "ruby_debug.h"

#define DEBUG_VERSION "0.11.25"
#define DEBUG_VERSION "0.11.26"

#define FRAME_N(n) (&debug_context->frames[debug_context->stack_size-(n)-1])
#define GET_FRAME (FRAME_N(check_frame_number(debug_context, frame)))
Expand Down Expand Up @@ -841,7 +841,7 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
{
case RUBY_EVENT_LINE:
{
if(debug_context->stack_size == 0)
if(debug_context->stack_size == 0 || get_top_frame(debug_context)->info.runtime.block_iseq != thread->cfp->block_iseq)
save_call_frame(event, debug_context, self, file, line, mid);
else
set_frame_source(event, debug_context, self, file, line, mid);
Expand Down

0 comments on commit 9fb5941

Please sign in to comment.