Skip to content

Commit c2cd54d

Browse files
committed
Slice-global-inits requires function-pointer removal
It uses `call_grapht`, which in turn expects function pointers to have been resolved beforehand.
1 parent 6bdfaf5 commit c2cd54d

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
int foo()
2+
{
3+
}
4+
5+
int main()
6+
{
7+
int (*fp)() = &foo;
8+
(*fp)();
9+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
--slice-global-inits
4+
^VERIFICATION SUCCESSFUL$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring

src/goto-instrument/goto_instrument_parse_options.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,6 +1481,8 @@ void goto_instrument_parse_optionst::instrument_goto_program()
14811481

14821482
if(cmdline.isset("slice-global-inits"))
14831483
{
1484+
do_indirect_call_and_rtti_removal();
1485+
14841486
log.status() << "Slicing away initializations of unused global variables"
14851487
<< messaget::eom;
14861488
slice_global_inits(goto_model, ui_message_handler);

0 commit comments

Comments
 (0)