Skip to content

Commit 6c0ff32

Browse files
thk123peterschrammel
thk123
authored andcommitted
Don't allowing functions called from _Start to be inlined
When the partial inlining comes to the _Start function, it skips over it. We don't want inlining on the start function because if we are trying to find the entry point for the users code, it is important it hasn't been inlined into GOTO generated code.
1 parent 8809a4c commit 6c0ff32

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/goto-programs/goto_inline.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,12 @@ void goto_partial_inline(
213213
// called function
214214
const goto_functiont &goto_function=f_it->second;
215215

216-
if(!goto_function.body_available())
216+
// We can't take functions without bodies to find functions
217+
// inside them to be inlined.
218+
// We also don't allow for the _start function to have any of its
219+
// function calls to be inlined
220+
if(!goto_function.body_available() ||
221+
f_it->first==ID__start)
217222
continue;
218223

219224
const goto_programt &goto_program=goto_function.body;

0 commit comments

Comments
 (0)