Repository navigation
Fix DecodeInvalidOpcode for 9-bit opcode codes - #2781
Merged
Merged
Conversation
When MAX_OPCODE_BITS was increased to 9, DecodeInvalidOpcode still used a hardcoded 0xff mask when unpacking the invalid opcode code. This caused any invalid opcode with a code >= 0x100 (such as unsupported SIMD opcodes) to be truncated to 8 bits when reported in error messages. Use ((1 << MAX_OPCODE_BITS) - 1) instead of 0xff so that 9-bit opcode codes are correctly preserved when reporting invalid opcodes. See: #2779
sbc100
force-pushed
the
fix-decode-invalid-opcode
branch
from
June 29, 2026 16:31
2e35897 to
9a0eda7
Compare
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.
When MAX_OPCODE_BITS was increased to 9, DecodeInvalidOpcode still used a hardcoded 0xff mask when unpacking the invalid opcode code. This caused any invalid opcode with a code >= 0x100 (such as unsupported SIMD opcodes) to be truncated to 8 bits when reported in error messages.
Use ((1 << MAX_OPCODE_BITS) - 1) instead of 0xff so that 9-bit opcode codes are correctly preserved when reporting invalid opcodes.
See #2779