Work around PR44697 in CrashRecoveryContext
authorHans Wennborg <hans@chromium.org>
Wed, 29 Jan 2020 15:21:08 +0000 (16:21 +0100)
committerHans Wennborg <hans@chromium.org>
Wed, 29 Jan 2020 15:35:07 +0000 (16:35 +0100)
llvm/lib/Support/CrashRecoveryContext.cpp

index b9031f5..510f46a 100644 (file)
@@ -195,8 +195,15 @@ static int ExceptionFilter(bool DumpStackAndCleanup,
   return EXCEPTION_EXECUTE_HANDLER;
 }
 
+#if defined(__clang__) && defined(_M_IX86)
+// Work around PR44697.
+__attribute__((optnone))
 static bool InvokeFunctionCall(function_ref<void()> Fn,
                                bool DumpStackAndCleanup, int &RetCode) {
+#else
+static bool InvokeFunctionCall(function_ref<void()> Fn,
+                               bool DumpStackAndCleanup, int &RetCode) {
+#endif
   __try {
     Fn();
   } __except (ExceptionFilter(DumpStackAndCleanup, GetExceptionInformation())) {