File tree 4 files changed +28
-2
lines changed
jbmc/regression/jbmc/JumpSimplification
4 files changed +28
-2
lines changed Original file line number Diff line number Diff line change
1
+ public class Test {
2
+
3
+ public int foo (int i ) {
4
+ int x = 0 ;
5
+ if (i > 0 ) {
6
+ x ++;
7
+ }
8
+ else
9
+ {
10
+ x --;
11
+ }
12
+ return x + 1000 ;
13
+ }
14
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ Test.class
3
+ --show-goto-functions --function Test.foo
4
+ activate-multi-line-match
5
+ EXIT=0
6
+ SIGNAL=0
7
+ IF \w* <= 0 THEN GOTO 1\n\s*//.*\n\s*//.*\n\s*\w*::
8
+ --
9
+ IF !\(\w* <= 0\) THEN GOTO 1\n\s*//.*\n.*GOTO 2\n\s*//.*\n\s*//.*\n\s*1: \w*::
10
+ ^warning: ignoring
Original file line number Diff line number Diff line change @@ -1460,8 +1460,10 @@ void goto_convertt::convert_goto(
1460
1460
const codet &code,
1461
1461
goto_programt &dest)
1462
1462
{
1463
- // this instruction will turn into a goto during post-processing
1464
- goto_programt::targett t=dest.add_instruction (NO_INSTRUCTION_TYPE);
1463
+ // this instruction will be completed during post-processing
1464
+ // it is required to mark this as GOTO in order to enable
1465
+ // simplifications in generate_ifthenelse
1466
+ goto_programt::targett t = dest.add_instruction (GOTO);
1465
1467
t->source_location =code.source_location ();
1466
1468
t->code =code;
1467
1469
You can’t perform that action at this time.
0 commit comments