Avoid invalid shift caused by excessive object bits#8864
Open
tautschnig wants to merge 1 commit intodiffblue:developfrom
Open
Avoid invalid shift caused by excessive object bits#8864tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig wants to merge 1 commit intodiffblue:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates pointer/object-bound computations to avoid undefined/invalid shifts when object_bits exceeds the host platform’s bit-width, by switching to mp_integer arithmetic.
Changes:
- Replace
std::size_t(1) << object_bitswithmp_integer-basedpower(2, object_bits)for computing max object count. - Tighten object-limit checks (notably
a >= max_objects). - Replace an
INVARIANTwith a thrownanalysis_exceptiontwhen pointer width is too small for object/offset encoding.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/solvers/smt2_incremental/convert_expr_to_smt.cpp | Uses mp_integer to compute max objects safely and throws an exception rather than asserting for width mismatch. |
| src/cprover/bv_pointers_wide.cpp | Uses mp_integer max objects and fixes boundary check to >= to prevent out-of-range object IDs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Use mp_integer to compute the number of permitted objects as the number of object bits is related to the analysis target platform and need not be within the analysis-execution platform's limits. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
8bdb8ca to
1b8144b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8864 +/- ##
===========================================
- Coverage 80.01% 80.01% -0.01%
===========================================
Files 1703 1703
Lines 188396 188400 +4
Branches 73 73
===========================================
+ Hits 150738 150739 +1
- Misses 37658 37661 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use mp_integer to compute the number of permitted objects as the number of object bits is related to the analysis target platform and need not be within the analysis-execution platform's limits.