Skip to content

Commit fc02e8f

Browse files
committed
Restore returns before writing the simplified binary
The static simplifier should not alter types of symbols. Doing so would cause conflicts if later attempting to link additional functions such as the C library as the types no longer match.
1 parent 49333eb commit fc02e8f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/goto-analyzer/static_simplifier.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Author: Martin Brain, [email protected]
1212
#include <util/options.h>
1313

1414
#include <goto-programs/goto_model.h>
15+
#include <goto-programs/remove_returns.h>
1516
#include <goto-programs/remove_skip.h>
1617
#include <goto-programs/remove_unreachable.h>
1718
#include <goto-programs/write_goto_binary.h>
@@ -169,6 +170,10 @@ bool static_simplifier(
169170
goto_model.goto_functions.update();
170171
}
171172

173+
// restore return types before writing the binary
174+
restore_returns(goto_model);
175+
goto_model.goto_functions.update();
176+
172177
m.status() << "Writing goto binary" << messaget::eom;
173178
return write_goto_binary(out,
174179
ns.get_symbol_table(),

0 commit comments

Comments
 (0)