Skip to content

properly set function id on instructions added by remove_asm #2741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions regression/goto-instrument/remove_asm1/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
void func()
{
asm("mfence");
}

int main(void)
{
func();
}
8 changes: 8 additions & 0 deletions regression/goto-instrument/remove_asm1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
main.c
--full-slice
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
3 changes: 3 additions & 0 deletions src/analyses/flow_insensitive_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ bool flow_insensitive_analysis_baset::do_function_call(
// get the state at the beginning of the function
locationt l_begin=goto_function.body.instructions.begin();

DATA_INVARIANT(
l_begin->function == f_it->first, "function names have to match");

// do the edge from the call site to the beginning of the function
new_data=state.transform(ns, l_call, l_begin);

Expand Down
3 changes: 3 additions & 0 deletions src/goto-programs/remove_asm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,9 @@ void remove_asmt::process_function(
it->make_skip();
did_something = true;

for(auto &instruction : tmp_dest.instructions)
instruction.function = it->function;

goto_programt::targett next=it;
next++;

Expand Down