summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-06-10 18:14:07 +0000
committerReid Kleckner <reid@kleckner.net>2015-06-10 18:14:07 +0000
commitc87a6faba162797b9187c1e717c2ff3b7daea9b6 (patch)
tree8dbabe39b1e56d831c112d80b63e162180f7c5a9 /llvm/lib/CodeGen/AsmPrinter/WinException.cpp
parent88c3c6799748a14a7decb48a31d4f99a72af1527 (diff)
downloadbcm5719-llvm-c87a6faba162797b9187c1e717c2ff3b7daea9b6.tar.gz
bcm5719-llvm-c87a6faba162797b9187c1e717c2ff3b7daea9b6.zip
[WinEH] _except_handlerN uses 0 instead of 1 to indicate catch-all
Our usage of 1 was a holdover from __C_specific_handler. llvm-svn: 239482
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/WinException.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/WinException.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
index 2bd9af55c30..40d6bab8b6d 100644
--- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
@@ -612,12 +612,10 @@ void WinException::emitExceptHandlerTable(const MachineFunction *MF) {
"gaps in the SEH scope table");
for (const SEHHandler &Handler : LPInfo->SEHHandlers) {
// Emit the filter or finally function pointer, if present. Otherwise,
- // emit '1' to indicate a catch-all.
- const MCExpr *FilterOrFinally;
- if (const Function *F = Handler.FilterOrFinally)
- FilterOrFinally = create32bitRef(Asm->getSymbol(F));
- else
- FilterOrFinally = MCConstantExpr::create(1, Asm->OutContext);
+ // emit '0' to indicate a catch-all.
+ const Function *F = Handler.FilterOrFinally;
+ const MCExpr *FilterOrFinally =
+ create32bitRef(F ? Asm->getSymbol(F) : nullptr);
// Compute the recovery address, which is a block address or null.
const BlockAddress *BA = Handler.RecoverBA;
OpenPOWER on IntegriCloud