From f3cfa6106be9ae17a0160db0b382d16c841e3e81 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Sat, 2 Feb 2013 21:10:56 +0000 Subject: [PATCH] Inform GCC of clobbered registers --- src/cat/LuaScriptInterface.cpp | 2 ++ src/pim/X86Native.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/cat/LuaScriptInterface.cpp b/src/cat/LuaScriptInterface.cpp index 2a6aa4156..f1984ee60 100644 --- a/src/cat/LuaScriptInterface.cpp +++ b/src/cat/LuaScriptInterface.cpp @@ -961,7 +961,9 @@ int LuaScriptInterface::updateNative(UPDATE_FUNC_ARGS) //std::cout << arg2 << std::endl; //std::cout << arg3 << std::endl; nativeFunction(i, x, y);*/ + __asm__("nop": : :"ecx", "ebx", "esi"); updateNativeCode[parts[i].type](i, x, y); + return 0; } diff --git a/src/pim/X86Native.cpp b/src/pim/X86Native.cpp index 6f857df33..ef77672ba 100644 --- a/src/pim/X86Native.cpp +++ b/src/pim/X86Native.cpp @@ -12,6 +12,8 @@ namespace pim for(int i = 0; i < 8; i++) { emit("90"); } //nop, helps find the code in memory with a debugger + + emit("BE"); //mov esi, machineStack emitConstantP((intptr_t)machineStack);