Skip to content

Commit 626804b

Browse files
committed
Restore returns before writing the simplified binary
Not doing so would cause conflicts if later attempting to link additional functions such as the C library.
1 parent 7fb0cb4 commit 626804b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/goto-analyzer/static_simplifier.cpp

Lines changed: 5 additions & 0 deletions
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>
@@ -220,6 +221,10 @@ bool static_simplifier(
220221
<< ", function calls: " << unmodified.function_calls
221222
<< messaget::eom;
222223

224+
// restore return types before writing the binary
225+
restore_returns(goto_model);
226+
goto_model.goto_functions.update();
227+
223228
m.status() << "Writing goto binary" << messaget::eom;
224229
return write_goto_binary(
225230
out, goto_model.get_symbol_table(), goto_model.goto_functions);

0 commit comments

Comments
 (0)