summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-07-06 21:13:43 +0000
committerReid Kleckner <reid@kleckner.net>2015-07-06 21:13:43 +0000
commitda76bd444f314bf2d56c9235e29e575654719442 (patch)
tree4aab91d2dc3b7f9185dae20b6e2b0403e9f1c642 /llvm/lib/CodeGen
parentd85cae3d52a36cbed6443abebe1d6ed77fc03cad (diff)
downloadbcm5719-llvm-da76bd444f314bf2d56c9235e29e575654719442.tar.gz
bcm5719-llvm-da76bd444f314bf2d56c9235e29e575654719442.zip
[WinEH] Insert the EH code load before the block terminator
The previous code put the load after the terminator, leading to invalid IR and downstream crashes. This caused http://crbug.com/506446. llvm-svn: 241509
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/WinEHPrepare.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp
index dbc0d91a01e..d56a242f98c 100644
--- a/llvm/lib/CodeGen/WinEHPrepare.cpp
+++ b/llvm/lib/CodeGen/WinEHPrepare.cpp
@@ -833,7 +833,7 @@ bool WinEHPrepare::prepareExceptionHandlers(
LoadInst *LI;
if (auto *Phi = dyn_cast<PHINode>(I))
LI = new LoadInst(SEHExceptionCodeSlot, "sehcode", false,
- Phi->getIncomingBlock(*U));
+ Phi->getIncomingBlock(*U)->getTerminator());
else
LI = new LoadInst(SEHExceptionCodeSlot, "sehcode", false, I);
U->set(LI);
OpenPOWER on IntegriCloud