Skip to content

Commit 625543b

Browse files
committed
compare stack_size only after start_inspector->fill_stack
1 parent b1ba8a2 commit 625543b

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

ext/debase_internals.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,6 @@ process_line_event(VALUE trace_point, void *data)
333333
tp = TRACE_POINT;
334334
path = rb_tracearg_path(tp);
335335

336-
if(context->stack_size <= context->init_stack_size && context->hit_user_code) {
337-
context->script_finished = 1;
338-
}
339-
if(context->script_finished) {
340-
return;
341-
}
342-
343336
if (is_path_accepted(path)) {
344337

345338
lineno = rb_tracearg_lineno(tp);
@@ -388,13 +381,18 @@ process_line_event(VALUE trace_point, void *data)
388381
breakpoint = breakpoint_find(breakpoints, path, lineno, trace_point);
389382
if (context->stop_next == 0 || context->stop_line == 0 || breakpoint != Qnil) {
390383
rb_ensure(start_inspector, context_object, stop_inspector, Qnil);
391-
context->stop_reason = CTX_STOP_STEP;
392-
if (breakpoint != Qnil) {
393-
context->stop_reason = CTX_STOP_BREAKPOINT;
394-
rb_funcall(context_object, idAtBreakpoint, 1, breakpoint);
384+
if(context->stack_size <= context->init_stack_size && context->hit_user_code) {
385+
context->script_finished = 1;
386+
}
387+
if(!context->script_finished) {
388+
context->stop_reason = CTX_STOP_STEP;
389+
if (breakpoint != Qnil) {
390+
context->stop_reason = CTX_STOP_BREAKPOINT;
391+
rb_funcall(context_object, idAtBreakpoint, 1, breakpoint);
392+
}
393+
reset_stepping_stop_points(context);
394+
call_at_line(context, file, line, context_object);
395395
}
396-
reset_stepping_stop_points(context);
397-
call_at_line(context, file, line, context_object);
398396
}
399397
}
400398
cleanup(context);

lib/debase/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Debase
2-
VERSION = "0.2.3" unless defined? VERSION
2+
VERSION = "0.2.4" unless defined? VERSION
33
end

0 commit comments

Comments
 (0)