M68K: Handle minimum signed displacements - #3041
Closed
carrerasdarren-cell wants to merge 1 commit into
Closed
Conversation
Author
|
Closing this after finding #2990, which covers the same three M68K INT32_MIN displacement sites and already follows the requested SStream-helper design. I missed that prior work in the pre-publication search; apologies for the duplicate and reviewer noise. |
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.
Your checklist for this pull request
Detailed description
M68K displacement printing currently calls
abs()on signed 32-bit values.abs(INT32_MIN)cannot be represented byint, so the operation has undefined behavior and triggers the public OSS-Fuzz report 484248078.Convert negative displacements through a signed 64-bit intermediate before narrowing their magnitude to
uint32_t. Apply the helper to base, inner, and outer 32-bit displacement formatting. Add regression coverage for both base-displacement and memory-indirect encodings atINT32_MIN.Test plan
xcrun clang-format --dry-run --Werror arch/M68K/M68KInstPrinter.cINT32_MINcasescstest tests/details/m68k.yaml(444 tests passed)git diff --checkClosing issues
Closes #3040