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