[all-commits] [llvm/llvm-project] ae2261: [X86] Don't emit personality info when the persona...
Zane Hambly via All-commits
all-commits at lists.llvm.org
Fri Jul 31 11:35:32 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ae2261652f14f760a931075ec5fbe05cdccbac02
https://github.com/llvm/llvm-project/commit/ae2261652f14f760a931075ec5fbe05cdccbac02
Author: Zane Hambly <zanehambly at gmail.com>
Date: 2026-07-31 (Fri, 31 Jul 2026)
Changed paths:
M llvm/lib/CodeGen/AsmPrinter/WinException.cpp
A llvm/test/CodeGen/X86/win-null-personality.ll
Log Message:
-----------
[X86] Don't emit personality info when the personality is not a function (#212803)
Follow-up to #212417, another one in the same corner.
`llc -mtriple=x86_64-pc-windows-msvc` crashes on a function whose
personality isn't a function:
```llvm
define void @a() personality ptr null {
ret void
}
```
`dyn_cast<Function>` gives null, and `beginFunclet` hands that straight
to `getSymbol`, which dereferences it.
`DwarfCFIException` already guards against this, applying the null check
to both branches:
```cpp
shouldEmitPersonality =
(forceEmitPersonality ||
(hasLandingPads && PerEncoding != dwarf::DW_EH_PE_omit)) && Per;
```
`WinException` has it inside the second operand, so
`forceEmitPersonality` bypasses it. Move it out so it gates both,
matching the Dwarf path.
The test covers both directions: the null personality no longer emits a
handler, and a real personality with a landing pad still emits
`.seh_handler __CxxFrameHandler3` as before. `CodeGen/WinEH` is 19/19.
Fixes #210285
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list