Skip to content

Conversation

@RMarx1456
Copy link

@RMarx1456 RMarx1456 commented Jan 21, 2026

The specific issue was caused by incorrect placement of operands in is_class in disasm.c

The issue fixes the specific bug shown in the issue as well as for the same instructions with a larger register size. The initial push itself has a commit with more technical details:
3ec5afd
"Fixed issue #193 by switching operand order of is_class at disasm/disasm.c:1519
Incorrect ordering led to specific encoding for implicit shift by one (M1 - UNITY from include/opflags.h & x86/insnsd.c) being skipped over in disasm.c:1519.

The skip over the UNITY block would lead to the code ending up at disasm.c:1569, adding 0x0 to the end of the instruction and moving onwards having emitted the incorrect instruction.

The correction of is_class is consistent with other usage of is_class in the disasm.c file and its signature in include/opflags.h ( static inline bool is_class(opflags_t class, opflags_t op) ); the error was placement of t in class and unity in op respectively."

Thank you for reading this and let me know if you need any changes or anything else involving this. I did forget to turn on the workflow runner when I forked this repository so I needed to just make a push to the branch so it would run and test the changes, so those are the extra two commits after the first commit.

…ass at disasm/disasm.c:1519

Incorrect ordering led to specific encoding for implicit shift by one (M1 - UNITY from include/opflags.h & x86/insnsd.c) being skipped over in disasm.c:1519.

The skip over the UNITY block would lead to the code ending up at disasm.c:1569, adding 0x0 to the end of the instruction and moving onwards having emitted the incorrect instruction.

The correction of is_class is consistent with other usage of is_class in the disasm.c file and its signature in include/opflags.h  ( static inline bool is_class(opflags_t class, opflags_t op) ); the error was placement of t in class and unity in op respectively.
@RMarx1456 RMarx1456 marked this pull request as ready for review January 21, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant