Repository navigation
Some code transformations required to allow -fbounds-safety to compile - #1686
Merged
Merged
Conversation
seanm
force-pushed
the
fbounds-safety-prep
branch
from
August 28, 2025 16:09
7913519 to
40aee85
Compare
Contributor
Author
|
@sonatique what do you think? |
Member
|
Are you fine with this PR now? Thanks. |
sonatique
approved these changes
Sep 19, 2025
Member
|
Pending review from @tormodvolden
|
Mr-Bossman
reviewed
Oct 17, 2025
seanm
force-pushed
the
fbounds-safety-prep
branch
from
January 11, 2026 05:54
40aee85 to
99c0a93
Compare
-fbounds-safety requires that pointer and its size are always set back-to-back with no intervening statements. Before this patch, the `if` statement was in the way. This changes also makes sure that length is set to 0 if the pointer is NULL.
-fbounds-safety requires that pointer and its size are always set back-to-back with no intervening statements. Before this patch, the loop was incrementing the count without also syncing the pointer, which does not compile. Added temporary variable to count then set pointer and size back-to-back. Also removed unneed NULL test since free(NULL) is well-defined to do nothing.
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.
Should be no change in behaviour.