Skip to content

Commit e53d2b4

Browse files
committed
fix for uninterpreted functions
CBMC supports uninterpreted functions; this feature had no test, and thus got broken with 5081310. Fixes #3561.
1 parent 8408181 commit e53d2b4

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
_Bool __CPROVER_uninterpreted_f();
2+
3+
main()
4+
{
5+
_Bool a = __CPROVER_uninterpreted_f();
6+
assert(0);
7+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
uf1.c
3+
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^VERIFICATION FAILED$
7+
--
8+
^warning: ignoring
9+
--
10+
Basic test for an uninterpreted function; based on issue #3561.

scripts/delete_failing_smt2_solver_tests

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ rm struct6/test.desc
7474
rm struct7/test.desc
7575
rm trace-values/trace-values.desc
7676
rm trace_show_function_calls/test.desc
77+
rm uninterpreted_function/uf1.desc
7778
rm union12/test.desc
7879
rm union6/test.desc
7980
rm union7/test.desc

src/goto-symex/build_goto_trace.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,16 @@ void set_internal_dynamic_object(
111111
{
112112
if(expr.id()==ID_symbol)
113113
{
114-
const irep_idt &id=to_ssa_expr(expr).get_original_name();
115-
const symbolt *symbol;
116-
if(!ns.lookup(id, symbol))
114+
if(expr.type().id() != ID_code)
117115
{
118-
bool result = symbol->type.get_bool(ID_C_dynamic);
119-
if(result)
120-
goto_trace_step.internal=true;
116+
const irep_idt &id = to_ssa_expr(expr).get_original_name();
117+
const symbolt *symbol;
118+
if(!ns.lookup(id, symbol))
119+
{
120+
bool result = symbol->type.get_bool(ID_C_dynamic);
121+
if(result)
122+
goto_trace_step.internal = true;
123+
}
121124
}
122125
}
123126
else

0 commit comments

Comments
 (0)