Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switch around the order of arguments to create a SIB reference.

Put the offset last and make it optional.
  • Loading branch information...
commit 28b6d0c46facfb01fb414a40e101b8c2e07916c1 1 parent 0a79628
Nelson Elhage authored
Showing with 3 additions and 3 deletions.
  1. +2 −2 bt.cpp
  2. +1 −1  x86.h
4 bt.cpp
View
@@ -508,7 +508,7 @@ inline void bt_translate_other(X86Assembler *buf, byteptr pc, bdecode *inst) {
bt_save_fault_entry(buf, pc);
#ifdef __x86_64__
- buf->mov(X86ECX, X86Mem(0, X86RDI, X86RAX));
+ buf->mov(X86ECX, X86Mem(X86RDI, X86RAX));
#else
buf->byte(PREFIX_SEG_FS);
buf->mov(X86ECX, X86Mem(X86EAX));
@@ -525,7 +525,7 @@ inline void bt_translate_other(X86Assembler *buf, byteptr pc, bdecode *inst) {
bt_save_fault_entry(buf, pc);
#ifdef __x86_64__
- buf->mov(X86Mem(0, X86RDI, X86RAX), X86EAX);
+ buf->mov(X86Mem(X86RDI, X86RAX), X86EAX);
#else
buf->byte(PREFIX_SEG_FS);
buf->mov(X86Mem(X86EAX), X86EAX);
2  x86.h
View
@@ -408,7 +408,7 @@ static inline X86ReferenceAbs X86Mem(uint32_t addr) {
X86ReferenceAbs r = {addr};
return r;
}
-static inline X86ReferenceSIB X86Mem(uint32_t off, X86Register base, X86Register index, uint8_t scale = 1) {
+static inline X86ReferenceSIB X86Mem(X86Register base, X86Register index, uint8_t scale = 1, uint32_t off = 0) {
X86ReferenceSIB r = {off, base, index, scale};
return r;
}
Please sign in to comment.
Something went wrong with that request. Please try again.