mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241509 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user