Actual AT&T syntax for this one, and do GCC inline asm correctly

This commit is contained in:
Ben "root" Anderson
2013-10-26 17:04:42 -05:00
parent fcb3be7c19
commit d61f2f8750
+5 -1
View File
@@ -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 );