From f2ec75e2028ce0e616fd4d4b45d72579aec95f7a Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sat, 29 Sep 2007 12:34:56 -0600 Subject: [PATCH] handle 32-bit immediate values in Assembler.push() --- src/compile.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/compile.cpp b/src/compile.cpp index b558370906..9789081dae 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -97,7 +97,11 @@ class Buffer { void appendAddress(uintptr_t v) { append4(v); if (BytesPerWord == 8) { + // we have to use the preprocessor here to avoid a warning on + // 32-bit systems +#ifdef __x86_64__ append4(v >> 32); +#endif } } @@ -304,10 +308,13 @@ class Assembler { } void push(int32_t v) { - assert(code.s, isByte(v)); // todo - - code.append(0x6a); - code.append(v); + if (isByte(v)) { + code.append(0x6a); + code.append(v); + } else { + code.append(0x68); + code.append4(v); + } } void pushAddress(uintptr_t v) {