From d61f2f875049054eb7b3f40a76a4918d88bfe8e2 Mon Sep 17 00:00:00 2001 From: "Ben \"root\" Anderson" Date: Sat, 26 Oct 2013 17:04:42 -0500 Subject: [PATCH] Actual AT&T syntax for this one, and do GCC inline asm correctly --- src/archutils/Win32/Crash.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/archutils/Win32/Crash.cpp b/src/archutils/Win32/Crash.cpp index b1e787447f..d9c9784882 100644 --- a/src/archutils/Win32/Crash.cpp +++ b/src/archutils/Win32/Crash.cpp @@ -364,10 +364,14 @@ long __stdcall CrashHandler::ExceptionHandler( EXCEPTION_POINTERS *pExc ) int iSize = 1024*32; char *pStack = (char *) VirtualAlloc( NULL, iSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE ); pStack += iSize; + // FIXME: This will probably explode on x86-64 #if defined(_MSC_VER) _asm mov esp, pStack; #elif defined(__GNUC__) - asm ("mov esp, pStack"); + asm volatile ("movl %%esp, %0\n\t" + : + : "r" (pStack) + ); #endif return MainExceptionHandler( pExc );