diff --git a/src/stats.c b/src/stats.c index fa44ed743a..724e1e11bf 100644 --- a/src/stats.c +++ b/src/stats.c @@ -240,6 +240,8 @@ UInt ExecIfElse ( } + SET_BRK_CALL_TO(stat); + /* otherwise execute the else-branch body and leave */ body = READ_STAT(stat, 3); return EXEC_STAT( body ); @@ -269,6 +271,7 @@ UInt ExecIfElif ( } + SET_BRK_CALL_TO(stat); } /* return 0 (to indicate that no leave-statement was executed) */ @@ -299,6 +302,7 @@ UInt ExecIfElifElse ( } + SET_BRK_CALL_TO(stat); } /* otherwise execute the else-branch body and leave */ @@ -689,6 +693,7 @@ static ALWAYS_INLINE UInt ExecWhileHelper(Stat stat, UInt nr) if (nr >= 3) EXEC_STAT_IN_LOOP(body3); + SET_BRK_CALL_TO(stat); } /* return 0 (to indicate that no leave-statement was executed) */ @@ -760,6 +765,8 @@ static ALWAYS_INLINE UInt ExecRepeatHelper(Stat stat, UInt nr) if (nr >= 3) EXEC_STAT_IN_LOOP(body3); + SET_BRK_CALL_TO(stat); + } while ( EVAL_BOOL_EXPR( cond ) == False ); /* return 0 (to indicate that no leave-statement was executed) */ diff --git a/tst/testspecial/backtrace.g.out b/tst/testspecial/backtrace.g.out index e70a4ee12e..b25c609bb3 100644 --- a/tst/testspecial/backtrace.g.out +++ b/tst/testspecial/backtrace.g.out @@ -64,7 +64,11 @@ gap> gap> f:=function() if 1 < 0 then return 1; elif 1 then return 2; fi; return 3; end;; gap> f(); Error, must be 'true' or 'false' (not a integer) in - 1 < 0 at *stdin*:18 called from + if 1 < 0 then + return 1; +elif 1 then + return 2; +fi; at *stdin*:18 called from ( ) called from read-eval loop at *stdin*:19 you can replace via 'return ;' @@ -130,7 +134,9 @@ gap> gap> f:=function() local x; repeat x:=1; until 1; return 2; end;; gap> f(); Error, must be 'true' or 'false' (not a integer) in - x := 1; at *stdin*:30 called from + repeat + x := 1; +until 1; at *stdin*:30 called from ( ) called from read-eval loop at *stdin*:31 you can replace via 'return ;'