diff options
author | Reid Kleckner <reid@kleckner.net> | 2015-07-10 00:08:49 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2015-07-10 00:08:49 +0000 |
commit | 85a2450d566a80fe115b249504ffd1d5d0ee1144 (patch) | |
tree | c276a0f188eb5469ef963a0a20434b0dd80ae55e /llvm/lib/CodeGen | |
parent | f40c1076c932be17d09be68d1654a83737ad357c (diff) | |
download | bcm5719-llvm-85a2450d566a80fe115b249504ffd1d5d0ee1144.tar.gz bcm5719-llvm-85a2450d566a80fe115b249504ffd1d5d0ee1144.zip |
[WinEH] Make sure LSDA tables are 4 byte aligned
Apparently this is important, otherwise _except_handler3 assumes that
the registration node is corrupted and ignores it.
Also fix a bug in WinEHPrepare where we would insert code after a
terminator instruction.
llvm-svn: 241877
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/WinException.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp index 0294a2b7c4b..55f97e6214b 100644 --- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp @@ -350,6 +350,7 @@ void WinException::emitCXXFrameHandler3Table(const MachineFunction *MF) { // EHFlags & 1 -> Synchronous exceptions only, no async exceptions. // EHFlags & 2 -> ??? // EHFlags & 4 -> The function is noexcept(true), unwinding can't continue. + OS.EmitValueToAlignment(4); OS.EmitLabel(FuncInfoXData); OS.EmitIntValue(0x19930522, 4); // MagicNumber OS.EmitIntValue(FuncInfo.UnwindMap.size(), 4); // MaxState @@ -578,6 +579,7 @@ void WinException::emitExceptHandlerTable(const MachineFunction *MF) { // Emit the __ehtable label that we use for llvm.x86.seh.lsda. MCSymbol *LSDALabel = Asm->OutContext.getOrCreateLSDASymbol(FLinkageName); + OS.EmitValueToAlignment(4); OS.EmitLabel(LSDALabel); const Function *Per = MMI->getPersonality(); |