[PATCH] D21231: [StackProtector] Fix computation of GSCookieOffset and EHCookieOffset with SEH4

Etienne Bergeron via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 10 13:44:18 PDT 2016


etienneb added inline comments.

================
Comment at: lib/CodeGen/AsmPrinter/WinException.cpp:968
@@ +967,3 @@
+    // Retrieve the EH Guard slot.
+    int EHCookieOffset = 9999;
+    if (FuncInfo.EHGuardFrameIndex != INT_MAX) {
----------------
majnemer wrote:
> Is it possible for this value to actually make it into the object file?
For now, I think it can be there.
But, when the feature will be implemented correctly, this should be turn as an "assert".

Would you prefer a TODO?
It's still on my plate to cleanup this.

================
Comment at: lib/Target/X86/X86WinEHState.cpp:302-304
@@ -292,6 +301,5 @@
 
     CxxLongjmpUnwind = TheModule->getOrInsertFunction(
         "__CxxLongjmpUnwind",
-        FunctionType::get(Type::getVoidTy(TheModule->getContext()), Int8PtrType,
-                          /*isVarArg=*/false));
+        FunctionType::get(VoidTy, Int8PtrType, /*isVarArg=*/false));
     cast<Function>(CxxLongjmpUnwind->stripPointerCasts())
----------------
majnemer wrote:
> Is __CxxLongjmpUnwind still used if we are using C++ exceptions + /GS?
I didn't look to C++ exceptions yet, neither the longjmp/setjmp implementation.
I want to fix the stack-frame layout to make SEH4 working for the _try/_catch case.
Then, I'll look to other cases using SEH4.



http://reviews.llvm.org/D21231





More information about the llvm-commits mailing list