Skip to content

Byte-extract lowering: do not blindly use offsets #7669

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
Apr 18, 2023

Conversation

tautschnig
Copy link
Collaborator

When unpacking an array we must not create 0 bytes up until an offset when the source array can never be as large. Doing so when within a struct would spuriously produce a larger member.

Fixes: #7654

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a 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.

@tautschnig tautschnig self-assigned this Apr 17, 2023
When unpacking an array we must not create 0 bytes up until an offset
when the source array can never be as large. Doing so when within a
struct would spuriously produce a larger member.

The test case highlighted a problem in the SMT2 back-end: the first
operand of a struct was not correctly flattened and instead used default
expression conversion (which is only ok when the array theory is never
being used). To avoid this problem creeping in again, factor out the
operand conversion into a lambda and invoke that lambda each time.

Fixes: diffblue#7654
@tautschnig tautschnig force-pushed the bugfixes/7654-byte-extract branch from 30e72b7 to d4e61f8 Compare April 18, 2023 12:38
@tautschnig tautschnig marked this pull request as ready for review April 18, 2023 12:39
@codecov
Copy link

codecov bot commented Apr 18, 2023

Codecov Report

Patch coverage: 97.61% and project coverage change: +0.08 🎉

Comparison is base (d2d7f76) 78.43% compared to head (d4e61f8) 78.52%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7669      +/-   ##
===========================================
+ Coverage    78.43%   78.52%   +0.08%     
===========================================
  Files         1674     1674              
  Lines       191939   191951      +12     
===========================================
+ Hits        150546   150723     +177     
+ Misses       41393    41228     -165     
Impacted Files Coverage Δ
src/solvers/smt2/smt2_conv.cpp 67.39% <92.85%> (-0.01%) ⬇️
src/solvers/smt2/smt2_parser.cpp 78.52% <100.00%> (ø)
src/util/lower_byte_operators.cpp 92.91% <100.00%> (+0.04%) ⬆️
src/util/simplify_expr.cpp 85.49% <100.00%> (+0.07%) ⬆️

... and 12 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@peterschrammel peterschrammel removed their assignment Apr 18, 2023
@tautschnig tautschnig merged commit 6f82023 into diffblue:develop Apr 18, 2023
@tautschnig tautschnig deleted the bugfixes/7654-byte-extract branch April 18, 2023 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky behavior for memcpy and struct arrays.
3 participants