File tree 1 file changed +9
-12
lines changed
1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,10 @@ class goto_checkt
188
188
typedef std::set<exprt> assertionst;
189
189
assertionst assertions;
190
190
191
+ // / Remove all assertions containing the symbol in \p lhs as well as all
192
+ // / assertions containing dereference.
193
+ // / \param lhs: the left-hand-side expression whose symbol should be
194
+ // / invalidated
191
195
void invalidate (const exprt &lhs);
192
196
193
197
bool enable_bounds_check;
@@ -261,21 +265,14 @@ void goto_checkt::invalidate(const exprt &lhs)
261
265
else if (lhs.id ()==ID_symbol)
262
266
{
263
267
// clear all assertions about 'symbol'
264
- find_symbols_sett find_symbols_set;
265
- find_symbols_set.insert (to_symbol_expr (lhs).get_identifier ());
268
+ find_symbols_sett find_symbols_set{to_symbol_expr (lhs).get_identifier ()};
266
269
267
- for (assertionst::iterator
268
- it=assertions.begin ();
269
- it!=assertions.end ();
270
- ) // no it++
270
+ for (auto it = assertions.begin (); it != assertions.end ();)
271
271
{
272
- assertionst::iterator next=it;
273
- next++;
274
-
275
272
if (has_symbol (*it, find_symbols_set) || has_subexpr (*it, ID_dereference))
276
- assertions.erase (it);
277
-
278
- it=next ;
273
+ it = assertions.erase (it);
274
+ else
275
+ ++it ;
279
276
}
280
277
}
281
278
else
You can’t perform that action at this time.
0 commit comments