]> granicus.if.org Git - clang/commitdiff
Use this one little trick to prevent optimizers from removing an
authorRichard Trieu <rtrieu@google.com>
Sat, 21 Dec 2013 01:04:02 +0000 (01:04 +0000)
committerRichard Trieu <rtrieu@google.com>
Sat, 21 Dec 2013 01:04:02 +0000 (01:04 +0000)
intentional stack overflow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197849 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Pragma.cpp

index e4059eeb6fc0a63d17084d5be97dff7d8fc4d0c6..b2f047a2fd1bad8df202601a48e84abae427c4c7 100644 (file)
@@ -926,8 +926,9 @@ struct PragmaDebugHandler : public PragmaHandler {
 #ifdef _MSC_VER
     #pragma warning(disable : 4717)
 #endif
-  void DebugOverflowStack() {
-    DebugOverflowStack();
+  static void DebugOverflowStack() {
+    void (*volatile Self)() = DebugOverflowStack;
+    Self();
   }
 #ifdef _MSC_VER
     #pragma warning(default : 4717)