mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-30 16:01:46 +00:00
Make more vm_x86 macros use braces so they work with if blah run macro
MASK_REG in EmitMovEDXStack would incorrectly emit asm if 'andit' was 0. 'andit' would never be 0 though so it wasn't causing issues. Found by Coverity.
This commit is contained in:
parent
ee2541efee
commit
2e904141ff
1 changed files with 13 additions and 7 deletions
|
@ -203,19 +203,25 @@ static void EmitRexString(byte rex, const char *string)
|
||||||
|
|
||||||
|
|
||||||
#define MASK_REG(modrm, mask) \
|
#define MASK_REG(modrm, mask) \
|
||||||
|
do { \
|
||||||
EmitString("81"); \
|
EmitString("81"); \
|
||||||
EmitString((modrm)); \
|
EmitString((modrm)); \
|
||||||
Emit4((mask))
|
Emit4((mask)); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
// add bl, bytes
|
// add bl, bytes
|
||||||
#define STACK_PUSH(bytes) \
|
#define STACK_PUSH(bytes) \
|
||||||
|
do { \
|
||||||
EmitString("80 C3"); \
|
EmitString("80 C3"); \
|
||||||
Emit1(bytes)
|
Emit1(bytes); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
// sub bl, bytes
|
// sub bl, bytes
|
||||||
#define STACK_POP(bytes) \
|
#define STACK_POP(bytes) \
|
||||||
|
do { \
|
||||||
EmitString("80 EB"); \
|
EmitString("80 EB"); \
|
||||||
Emit1(bytes)
|
Emit1(bytes); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
static void EmitCommand(ELastCommand command)
|
static void EmitCommand(ELastCommand command)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue