summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Pragma.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2017-04-24 18:41:00 +0000
committerMatthias Braun <matze@braunis.de>2017-04-24 18:41:00 +0000
commit285f88d4a3b99dcfef3d5c00eb0db50127ac27e3 (patch)
treefa7e0dba33399dbeef222a5c0fd92ae8f02127f8 /clang/lib/Lex/Pragma.cpp
parent0d447d514a5b46d4de8abf95d1f8cefc092b1ee8 (diff)
downloadbcm5719-llvm-285f88d4a3b99dcfef3d5c00eb0db50127ac27e3.tar.gz
bcm5719-llvm-285f88d4a3b99dcfef3d5c00eb0db50127ac27e3.zip
Pragma: Fix DebugOverflowStack() resulting in endless loop.
Drive-by fix (noticed while working on https://reviews.llvm.org/D32205): DebugOverflowStack() is supposed to provoke a stack overflow, however LLVM was smart enough to use the red-zone and fold the load into a tail jump on x86_64 optimizing this to an endless loop instead of a stack overflow. llvm-svn: 301218
Diffstat (limited to 'clang/lib/Lex/Pragma.cpp')
-rw-r--r--clang/lib/Lex/Pragma.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp
index f81eaa31e9e..87e105d1d03 100644
--- a/clang/lib/Lex/Pragma.cpp
+++ b/clang/lib/Lex/Pragma.cpp
@@ -989,9 +989,9 @@ struct PragmaDebugHandler : public PragmaHandler {
#ifdef _MSC_VER
#pragma warning(disable : 4717)
#endif
- static void DebugOverflowStack() {
- void (*volatile Self)() = DebugOverflowStack;
- Self();
+ static void DebugOverflowStack(void (*P)() = nullptr) {
+ void (*volatile Self)(void(*P)()) = DebugOverflowStack;
+ Self(reinterpret_cast<void(*)()>(Self));
}
#ifdef _MSC_VER
#pragma warning(default : 4717)
OpenPOWER on IntegriCloud