Skip to content

Commit 67ce46b

Browse files
Handle __CPROVER_set/get_field in goto_symex
Symbolically executes the respective shadow memory access calls. These produce assignments by calling symex_assign.
1 parent 38b264b commit 67ce46b

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/goto-symex/symex_function_call.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,24 @@ void goto_symext::symex_function_call_symbol(
207207

208208
target.location(state.guard.as_expr(), state.source);
209209

210-
symex_function_call_post_clean(
211-
get_goto_function, state, cleaned_lhs, function, cleaned_arguments);
210+
PRECONDITION(function.id() == ID_symbol);
211+
const irep_idt &identifier = to_symbol_expr(function).get_identifier();
212+
213+
if(identifier == CPROVER_PREFIX SHADOW_MEMORY_GET_FIELD)
214+
{
215+
shadow_memory.symex_get_field(state, cleaned_lhs, cleaned_arguments);
216+
symex_transition(state);
217+
}
218+
else if(identifier == CPROVER_PREFIX SHADOW_MEMORY_SET_FIELD)
219+
{
220+
shadow_memory.symex_set_field(state, cleaned_arguments);
221+
symex_transition(state);
222+
}
223+
else
224+
{
225+
symex_function_call_post_clean(
226+
get_goto_function, state, cleaned_lhs, function, cleaned_arguments);
227+
}
212228
}
213229

214230
void goto_symext::symex_function_call_post_clean(

0 commit comments

Comments
 (0)