Skip to content

Commit f8a1bad

Browse files
author
thk123
committed
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 a1b6623 commit f8a1bad

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/goto-programs/goto_inline.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -826,8 +826,17 @@ void goto_partial_inline(
826826
it=goto_functions.function_map.begin();
827827
it!=goto_functions.function_map.end();
828828
it++)
829-
if(it->second.body_available())
829+
{
830+
// We can't take functions without bodies to find functions
831+
// inside them to be inlined.
832+
// We also don't allow for the _start function to have any of its
833+
// function calls to be inlined
834+
if(it->second.body_available() &&
835+
it->first!=ID__start)
836+
{
830837
goto_inline.goto_inline_rec(it, false);
838+
}
839+
}
831840
}
832841

833842
catch(int)

0 commit comments

Comments
 (0)