Repository navigation
Simplifier: a sizeof factor of one keeps its annotation - #9421
Open
tautschnig wants to merge 1 commit into
Open
tautschnig wants to merge 1 commit into
tautschnig wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
symex_allocate takes the element type of `malloc(sizeof(T) * n)' from the product's sizeof annotation. simplify_mult deleted a factor of one together with its annotation, so with n a constant computed from another sizeof -- `sizeof(char) * (5 * sizeof(long))', as libstdc++'s num_put::_M_insert_int allocates its digit buffer -- the object became a long[5], and every char store a byte_update that constant propagation could not see through. The factor is still deleted (kept, it would leave `1 * n' in the formula of every char allocation), but its annotation moves onto the product; and a typecast simplified to a constant keeps its own annotation over its operand's, so `(size_t)ilen' stays a char size once ilen is propagated. New test cbmc/alloca_sizeof_char_times_sizeof_constant. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
tautschnig
force-pushed
the
pr/simplify-sizeof-factor-one
branch
from
November 10, 2026 15:33
36fbc0c to
9ea6cd6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #9421 +/- ##
===========================================
- Coverage 81.02% 81.02% -0.01%
===========================================
Files 1723 1723
Lines 191314 191321 +7
Branches 73 73
===========================================
+ Hits 155020 155024 +4
- Misses 36294 36297 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
symex_allocate takes the element type of
malloc(sizeof(T) * n)' from the product's sizeof annotation. simplify_mult deleted a factor of one together with its annotation, so with n a constant computed from another sizeof --sizeof(char) * (5 * sizeof(long))', as libstdc++'s num_put::_M_insert_int allocates its digit buffer -- the object became a long[5], and every char store a byte_update that constant propagation could not see through. The factor is still deleted (kept, it would leave1 * n' in the formula of every char allocation), but its annotation moves onto the product; and a typecast simplified to a constant keeps its own annotation over its operand's, so(size_t)ilen' stays a char size once ilen is propagated. New test cbmc/alloca_sizeof_char_times_sizeof_constant.