Skip to content

goto_symex: implement SET_RETURN_VALUE #6436

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
Nov 17, 2021
Merged

Conversation

kroening
Copy link
Member

@kroening kroening commented Nov 3, 2021

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@kroening kroening force-pushed the symex_set_return_value branch 12 times, most recently from 1096994 to 3f7cadb Compare November 5, 2021 11:48
@kroening kroening marked this pull request as ready for review November 5, 2021 12:51
@codecov
Copy link

codecov bot commented Nov 5, 2021

Codecov Report

Merging #6436 (80fe6ff) into develop (bfa4c2c) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6436      +/-   ##
===========================================
- Coverage    76.01%   76.00%   -0.01%     
===========================================
  Files         1527     1528       +1     
  Lines       164465   164469       +4     
===========================================
- Hits        125013   125011       -2     
- Misses       39452    39458       +6     
Impacted Files Coverage Δ
src/goto-programs/validate_goto_model.cpp 100.00% <ø> (ø)
src/goto-symex/frame.h 100.00% <ø> (ø)
src/goto-symex/goto_symex.h 92.30% <ø> (ø)
unit/goto-programs/goto_program_validate.cpp 100.00% <ø> (ø)
src/goto-analyzer/goto_analyzer_parse_options.cpp 72.07% <100.00%> (+0.08%) ⬆️
src/goto-programs/mm_io.cpp 100.00% <100.00%> (ø)
src/goto-programs/process_goto_program.cpp 100.00% <100.00%> (ø)
src/goto-symex/symex_function_call.cpp 95.45% <100.00%> (+2.27%) ⬆️
src/goto-symex/symex_main.cpp 86.51% <100.00%> (+0.58%) ⬆️
src/goto-symex/symex_set_return_value.cpp 100.00% <100.00%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e27dba6...80fe6ff. Read the comment docs.

Comment on lines +123 to +133
const auto &value_symbol = get_fresh_aux_symbol(
to_code_type(mm_io_r.type()).return_type(),
id2string(id_r) + "$value",
id2string(id_r) + "$value",
maybe_symbol->location,
maybe_symbol->mode,
symbol_table);

mm_io_r_value = value_symbol.symbol_expr();
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the changes to mm_io necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current implementation assumes that the return value is in the function#return_value variable. It needs to be changed to use the lhs in the function call.

remove_returns(goto_model);
if(
options.get_bool_option("remove-returns") ||
options.get_bool_option("string-abstraction"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String abstraction was built well before return-value removal, so I wouldn't really expect a dependency here. In 425731b I noticed a need for some fixes, but I don't think that there should be a general requirement for return-value removal to make string abstraction work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unclear what the effort is. Might not be worth it, given that this feature has no known users.

This (re-)implements the goto-instruction SET_RETURN_VALUE in goto_symex.
This enables dropping the requirement that SET_RETURN_INSTRUCTIONS are
removed prior to invoking symex.
@kroening kroening force-pushed the symex_set_return_value branch from 3f7cadb to 80fe6ff Compare November 17, 2021 10:20
@tautschnig tautschnig merged commit 720f7c8 into develop Nov 17, 2021
@tautschnig tautschnig deleted the symex_set_return_value branch November 17, 2021 15:17
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