summaryrefslogtreecommitdiffhomepage
path: root/src/x86.c
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2024-09-06 21:55:42 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2024-09-06 21:55:42 +0100
commit8bb4226f07b1e9ee79f3429a1495eaa694b13334 (patch)
tree704a18fdc15bee0f1ee3460e150f84263194bfa4 /src/x86.c
parentdcb191f4f4b7da94f6e4489c80966f5f8f9f8d4b (diff)
Fix more broken x86 cases
Thanks Evan Lin for reporting.
Diffstat (limited to 'src/x86.c')
-rw-r--r--src/x86.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/x86.c b/src/x86.c
index 7a5d00e..e0431d6 100644
--- a/src/x86.c
+++ b/src/x86.c
@@ -1,5 +1,5 @@
/*
- * Copyright © 2023 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2024 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -25,6 +25,7 @@ static int mrmsib(const uchar *p, int addrlen) {
// But it's confusingly-written enough that the code I wrote before didn't
// work, so with any luck nobody will need to refer to it again and this is
// actually correct now. Fingers crossed.
+ if ((*p & 0xC6) == 0x06) return 3; // special case for disp16
if (addrlen == 4 || *p & 0xC0) {
int sib = addrlen == 4 && *p < 0xC0 && (*p & 7) == 4;
switch (*p & 0xC0) {