We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6879ae4 commit 15610d6Copy full SHA for 15610d6
src/goto-programs/rewrite_union.cpp
@@ -101,17 +101,16 @@ void rewrite_union(exprt &expr)
101
102
void rewrite_union(goto_functionst::goto_functiont &goto_function)
103
{
104
- Forall_goto_program_instructions(it, goto_function.body)
105
- {
106
- rewrite_union(it->code);
107
-
108
- if(it->has_condition())
109
110
- exprt c = it->get_condition();
111
- rewrite_union(c);
112
- it->set_condition(c);
113
- }
114
+ for(auto &instruction : goto_function.body.instructions)
+ instruction.transform([](exprt src) -> optionalt<exprt> {
+ if(!have_to_rewrite_union(src))
+ return {};
+ else
+ {
+ rewrite_union(src);
+ return src;
+ }
+ });
115
}
116
117
void rewrite_union(goto_functionst &goto_functions)
0 commit comments