Skip to content

Restore returns fix #294

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 2 commits into from
Nov 7, 2016
Merged

Restore returns fix #294

merged 2 commits into from
Nov 7, 2016

Conversation

danpoe
Copy link
Contributor

@danpoe danpoe commented Nov 3, 2016

No description provided.

@kroening
Copy link
Member

kroening commented Nov 3, 2016

Do you happen to have a test?

@tautschnig
Copy link
Collaborator

Just to say that I've run into the same problem, I'll try to provide an example.

@tautschnig
Copy link
Collaborator

Here's an example:

$ cat ret.c
int foo()
{
  int x;
  return x;
}

int main()
{
  foo();
  return 0;
}

Compile it and then run it past dump-c (to trigger restore-returns) with remove-returns having been done, as is the case in the escape analysis:

$ goto-cc/goto-cc ret.c
$ goto-instrument/goto-instrument --escape-analysis --dump-c a.out
Reading GOTO program from `a.out'
Function Pointer Removal
Partial Inlining
Removing returns
Escape Analysis
goto-instrument: remove_returns.cpp:336: bool remove_returnst::restore_returns(std::map<dstring, goto_function_templatet<goto_programt>, std::less<dstring>, std::allocator<std::pair<const dstring, goto_function_templatet<goto_programt> > > >::iterator): Assertion `next->is_goto()' failed.
Aborted

@danpoe
Copy link
Contributor Author

danpoe commented Nov 5, 2016

Thanks Michael. I've added this as a regression test.

@kroening kroening merged commit 92e9f27 into diffblue:master Nov 7, 2016
@danpoe danpoe deleted the remove-returns branch November 7, 2016 21:08
smowton pushed a commit to smowton/cbmc that referenced this pull request May 9, 2018
…cise-access-paths

turn on precise access paths in very limited situations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants