Skip to content

Commit 2ff0b38

Browse files
author
Daniel Kroening
committed
add arguments of function calls to goto_trace
1 parent 3304264 commit 2ff0b38

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

src/goto-symex/symex_function_call.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,14 @@ void goto_symext::symex_function_call_code(
254254
return;
255255
}
256256

257+
// read the arguments -- before the locality renaming
258+
exprt::operandst arguments = call.arguments();
259+
for(auto &a : arguments)
260+
state.rename(a, ns);
261+
257262
// record the call
258-
target.function_call(state.guard.as_expr(), identifier, state.source);
263+
target.function_call(
264+
state.guard.as_expr(), identifier, arguments, state.source);
259265

260266
if(!goto_function.body_available())
261267
{
@@ -276,11 +282,6 @@ void goto_symext::symex_function_call_code(
276282
return;
277283
}
278284

279-
// read the arguments -- before the locality renaming
280-
exprt::operandst arguments=call.arguments();
281-
for(auto &a : arguments)
282-
state.rename(a, ns);
283-
284285
// produce a new frame
285286
PRECONDITION(!state.call_stack().empty());
286287
goto_symex_statet::framet &frame=state.new_frame();

src/goto-symex/symex_target.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ class symex_targett
105105
virtual void function_call(
106106
const exprt &guard,
107107
const irep_idt &function_identifier,
108-
const sourcet &source)=0;
108+
const std::vector<exprt> &ssa_arguments,
109+
const sourcet &source) = 0;
109110

110111
// record return from a function
111112
virtual void function_return(

src/goto-symex/symex_target_equation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ void symex_target_equationt::location(
210210
void symex_target_equationt::function_call(
211211
const exprt &guard,
212212
const irep_idt &function_identifier,
213+
const std::vector<exprt> &ssa_arguments,
213214
const sourcet &source)
214215
{
215216
SSA_steps.push_back(SSA_stept());
@@ -219,6 +220,7 @@ void symex_target_equationt::function_call(
219220
SSA_step.type = goto_trace_stept::typet::FUNCTION_CALL;
220221
SSA_step.source = source;
221222
SSA_step.function_identifier = function_identifier;
223+
SSA_step.ssa_arguments = ssa_arguments;
222224

223225
merge_ireps(SSA_step);
224226
}
@@ -705,6 +707,9 @@ void symex_target_equationt::merge_ireps(SSA_stept &SSA_step)
705707
for(auto &step : SSA_step.io_args)
706708
merge_irep(step);
707709

710+
for(auto &arg : SSA_step.ssa_arguments)
711+
merge_irep(arg);
712+
708713
// converted_io_args is merged in convert_io
709714
}
710715

src/goto-symex/symex_target_equation.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class symex_target_equationt:public symex_targett
7575
virtual void function_call(
7676
const exprt &guard,
7777
const irep_idt &function_identifier,
78+
const std::vector<exprt> &ssa_arguments,
7879
const sourcet &source);
7980

8081
// record return from a function
@@ -232,6 +233,9 @@ class symex_target_equationt:public symex_targett
232233
// for function call/return
233234
irep_idt function_identifier;
234235

236+
// for function calls
237+
std::vector<exprt> ssa_arguments;
238+
235239
// for SHARED_READ/SHARED_WRITE and ATOMIC_BEGIN/ATOMIC_END
236240
unsigned atomic_section_id=0;
237241

0 commit comments

Comments
 (0)