Skip to content

member_exprt now checks type of compound operand #6949

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
Jul 18, 2022

Conversation

kroening
Copy link
Member

This commit adds a precondition to the constructors of member_exprt that
enforces that the compound operand has one of the compound types.

A legacy constructor is offered to ease the transition.

  • 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).
  • 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.

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

It seems the need for unchecked exclusively stems from tests? Can we just fix them instead?

@kroening kroening force-pushed the member_exprt_check branch 4 times, most recently from 5009854 to 716545f Compare June 20, 2022 11:09
@kroening kroening marked this pull request as ready for review June 20, 2022 11:39
@codecov
Copy link

codecov bot commented Jun 20, 2022

Codecov Report

Merging #6949 (55fc192) into develop (711cc67) will increase coverage by 0.01%.
The diff coverage is 97.43%.

@@             Coverage Diff             @@
##           develop    #6949      +/-   ##
===========================================
+ Coverage    77.85%   77.86%   +0.01%     
===========================================
  Files         1569     1569              
  Lines       180670   180821     +151     
===========================================
+ Hits        140662   140801     +139     
- Misses       40008    40020      +12     
Impacted Files Coverage Δ
.../analyses/variable-sensitivity/write_stack_entry.h 100.00% <ø> (ø)
src/goto-cc/armcc_cmdline.cpp 22.22% <ø> (ø)
src/goto-cc/gcc_cmdline.cpp 79.23% <ø> (ø)
src/goto-cc/ms_cl_cmdline.cpp 0.00% <ø> (ø)
...smt2_incremental/construct_value_expr_from_smt.cpp 100.00% <ø> (ø)
unit/solvers/smt2_incremental/smt_terms.cpp 93.23% <92.15%> (-0.67%) ⬇️
src/analyses/variable-sensitivity/write_stack.cpp 87.50% <94.11%> (-0.12%) ⬇️
...rc/solvers/smt2_incremental/smt_to_smt2_string.cpp 95.65% <95.65%> (+1.24%) ⬆️
...de/java_trace_validation/java_trace_validation.cpp 100.00% <100.00%> (ø)
...nalyses/variable-sensitivity/write_stack_entry.cpp 100.00% <100.00%> (ø)
... and 20 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 f9bd83e...55fc192. Read the comment docs.

@tautschnig tautschnig force-pushed the member_exprt_check branch from 716545f to 80e5b1a Compare June 20, 2022 22:00
@@ -55,7 +59,7 @@ TEST_CASE("Tracking object base expressions", "[core][smt2_incremental]")
address_of_exprt{index_exprt{foo, index}, pointer_type}, bar_address},
notequal_exprt{
address_of_exprt{
member_exprt{foo, "baz", unsignedbv_typet{8}}, pointer_type},
member_exprt::unchecked(foo, "baz", unsignedbv_typet{8}), pointer_type},
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will still need fixing?

@kroening kroening force-pushed the member_exprt_check branch from 11089b4 to 88d3b5e Compare July 14, 2022 10:42
This commit adds a precondition to the constructors of member_exprt that
enforces that the compound operand has one of the compound types.
@kroening kroening force-pushed the member_exprt_check branch from 88d3b5e to 55fc192 Compare July 14, 2022 18:35
@@ -12,41 +12,12 @@
#include <string>
#include <utility>

TEST_CASE("find_object_base_expression", "[core][smt2_incremental]")
Copy link
Member

Choose a reason for hiding this comment

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

@thomasspriggs is going to re-add a fixed version of this test after this PR has been merged.

@peterschrammel peterschrammel removed their assignment Jul 18, 2022
@kroening kroening merged commit e59bbcd into develop Jul 18, 2022
@kroening kroening deleted the member_exprt_check branch July 18, 2022 23:50
@thomasspriggs thomasspriggs mentioned this pull request Jul 19, 2022
7 tasks
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.

5 participants