@@ -41,8 +41,22 @@ static bool is_symbol_member(const exprt &expr)
41
41
return false ;
42
42
}
43
43
44
- static exprt
45
- make_assigns_assertion (const exprt::operandst &assigns, const exprt &lhs)
44
+ // add the function to the source location
45
+ exprt add_function (irep_idt function_identifier, exprt src)
46
+ {
47
+ for (auto &op : src.operands ())
48
+ op = add_function (function_identifier, op);
49
+
50
+ if (!src.source_location ().get_file ().empty ())
51
+ src.add_source_location ().set_function (function_identifier);
52
+
53
+ return src;
54
+ }
55
+
56
+ static exprt make_assigns_assertion (
57
+ irep_idt function_identifier,
58
+ const exprt::operandst &assigns,
59
+ const exprt &lhs)
46
60
{
47
61
// trivial match?
48
62
if (is_symbol_member (lhs))
@@ -72,6 +86,7 @@ make_assigns_assertion(const exprt::operandst &assigns, const exprt &lhs)
72
86
}
73
87
else
74
88
{
89
+ // auto fixed_a = add_function(function_identifier, a);
75
90
auto target_address = make_address (a);
76
91
auto lhs_address = make_address (lhs);
77
92
lhs_address =
@@ -150,18 +165,6 @@ exprt replace_old(
150
165
}
151
166
}
152
167
153
- // add the function to the source location
154
- exprt add_function (irep_idt function_identifier, exprt src)
155
- {
156
- for (auto &op : src.operands ())
157
- op = add_function (function_identifier, op);
158
-
159
- if (!src.source_location ().get_file ().empty ())
160
- src.add_source_location ().set_function (function_identifier);
161
-
162
- return src;
163
- }
164
-
165
168
void instrument_contract_checks (
166
169
goto_functionst::function_mapt::value_type &f,
167
170
const namespacet &ns)
@@ -246,7 +249,7 @@ void instrument_contract_checks(
246
249
247
250
// maybe not ok
248
251
auto assigns_assertion =
249
- make_assigns_assertion (contract.assigns (), lhs);
252
+ make_assigns_assertion (f. first , contract.assigns (), lhs);
250
253
auto location = it->source_location ();
251
254
location.set_property_class (" assigns" );
252
255
location.set_comment (" assigns clause" );
0 commit comments