Bug 524256 - Crash stacks not unwound correctly past NS_InvokeByIndex_P on Windows: use a #pragma to inform MSVC that the function has a frame pointer and it should not emit a specialized FPO stack-walking program, r=ted
authorBenjamin Smedberg <benjamin@smedbergs.us>
Tue, 27 Oct 2009 09:38:03 -0400
changeset 34233 15f4223cd977045852702c2d552ffc7e1fc0cbf4
parent 34232 29d7c945849de259737e1ba2c5ff84056b149d3b
child 34234 b84cac8a50eadbb2633b3b8ad7cbe30f858cf670
push idunknown
push userunknown
push dateunknown
reviewersted
bugs524256
milestone1.9.3a1pre
Bug 524256 - Crash stacks not unwound correctly past NS_InvokeByIndex_P on Windows: use a #pragma to inform MSVC that the function has a frame pointer and it should not emit a specialized FPO stack-walking program, r=ted
xpcom/reflect/xptcall/src/md/win32/xptcinvoke.cpp
--- a/xpcom/reflect/xptcall/src/md/win32/xptcinvoke.cpp
+++ b/xpcom/reflect/xptcall/src/md/win32/xptcinvoke.cpp
@@ -72,16 +72,19 @@ invoke_copy_to_stack(PRUint32* d, PRUint
             // all the others are plain pointer types
             *((void**)d) = s->val.p;
             break;
         }
     }
 }
 
 #pragma warning(disable : 4035) // OK to have no return value
+// Tell the PDB file this function has a standard frame pointer, and not to use
+// a custom FPO program.
+#pragma optimize( "y", off )
 extern "C" NS_EXPORT __declspec(naked) nsresult NS_FROZENCALL
 NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
                  PRUint32 paramCount, nsXPTCVariant* params)
 {
     __asm {
         push    ebp
         mov     ebp,esp
         mov     edx,paramCount      // Save paramCount for later