Skip to content

Commit 9fb5941

Browse files
committed
fix segfault on block calls (http://youtrack.jetbrains.net/issue/RUBY-7586)
1 parent cd6f940 commit 9fb5941

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/ruby_debug/ruby_debug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <insns_info.inc>
1010
#include "ruby_debug.h"
1111

12-
#define DEBUG_VERSION "0.11.25"
12+
#define DEBUG_VERSION "0.11.26"
1313

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

0 commit comments

Comments
 (0)