Skip to content

Commit 3f4c9d1

Browse files
authored
Merge pull request diffblue#986 from owen-jones-diffblue/bugfix/goto-trace-contains-ssa-information-test-gen-support
Remove SSA ids from goto trace
2 parents 7c415e8 + a9d96f6 commit 3f4c9d1

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

regression/cbmc/pointer-function-parameters-2/test.desc

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ main.c
55
^\*\* Used 4 iterations$
66
^Test suite:$
77
^a=\(\(signed int \*\*\)NULL\), tmp\$1=[^,]*, tmp\$2=[^,]*$
8-
^a=&tmp\$1!0, tmp\$1=\(\(signed int \*\)NULL\), tmp\$2=[^,]*$
9-
^a=&tmp\$1!0, tmp\$1=&tmp\$2!0, tmp\$2=([012356789][0-9]*|4[0-9]+)$
10-
^a=&tmp\$1!0, tmp\$1=&tmp\$2!0, tmp\$2=4$
8+
^a=&tmp\$1, tmp\$1=\(\(signed int \*\)NULL\), tmp\$2=[^,]*$
9+
^a=&tmp\$1, tmp\$1=&tmp\$2, tmp\$2=([012356789][0-9]*|4[0-9]+)$
10+
^a=&tmp\$1, tmp\$1=&tmp\$2, tmp\$2=4$
1111
--
1212
^warning: ignoring

regression/cbmc/pointer-function-parameters/test.desc

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ main.c
55
^\*\* Used 3 iterations$
66
^Test suite:$
77
^a=\(\(signed int \*\)NULL\), tmp\$1=[^,]*$
8-
^a=&tmp\$1!0, tmp\$1=4$
9-
^a=&tmp\$1!0, tmp\$1=([012356789][0-9]*|4[0-9]+)$
8+
^a=&tmp\$1, tmp\$1=4$
9+
^a=&tmp\$1, tmp\$1=([012356789][0-9]*|4[0-9]+)$
1010
--
1111
^warning: ignoring

src/goto-symex/build_goto_trace.cpp

+11-2
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,17 @@ void build_goto_trace(
308308
goto_trace_step.io_args.push_back(j);
309309
else
310310
{
311-
exprt tmp=prop_conv.get(j);
312-
goto_trace_step.io_args.push_back(tmp);
311+
// we only expect constants here
312+
exprt expr=to_constant_expr(prop_conv.get(j));
313+
if(expr.has_operands() && expr.op0().id()==ID_address_of)
314+
{
315+
exprt *op=&(to_address_of_expr(expr.op0()).object());
316+
while(op->id()==ID_member || op->id()==ID_index)
317+
op=&(op->op0());
318+
*op=to_ssa_expr(*op).get_original_expr();
319+
}
320+
// use expr in the output
321+
goto_trace_step.io_args.push_back(expr);
313322
}
314323
}
315324

0 commit comments

Comments
 (0)