mirror-llvm-project/llvm/lib
Derek Schuff a255c1ed36 [WebAssembly] Avoid crash in LateEHPrepare with empty cleanup pads (#200322)
WebAssemblyLateEHPrepare::addCatchRefsAndThrowRefs was using
Catch->getIterator()->getNextNode() to find the insertion position
after the CATCH (or CATCH_ALL) instruction in an EH pad.
If the CATCH/CATCH_ALL instruction is the last instruction in the basic
block, getNextNode() returns nullptr, which causees a crash when passed
to BuildMI. This patch fixes it by using std::next(Catch->getIterator())
which returns MBB.end() if the catch is the last instruction, and the
overload of BuildMI that takes an iterator correctly handles BB.end().

Fixes #197077

Assisted-By: Gemini
(cherry picked from commit dc40fccbc1)
2026-06-01 07:23:32 +00:00
..
ABI [LLVMABI] Implement the ABI Typesystem (#158329) 2026-01-01 07:52:55 +05:30
Analysis [NFC] Fix use-after-free: track TargetLibraryAnalysis in BasicAAResult invalidation (#183852) 2026-03-05 17:29:02 +00:00
AsmParser [LLVM][ADT] Migrate users of make_scope_exit to CTAD (#174030) 2026-01-02 20:42:56 -08:00
BinaryFormat [RISCV] Add basic Mach-O triple support. (#141682) 2026-01-05 23:18:48 +00:00
Bitcode [IR] Don't store switch case values as operands 2025-12-11 18:38:39 +01:00
Bitstream
CAS [LLVM][ADT] Migrate users of make_scope_exit to CTAD (#174030) 2026-01-02 20:42:56 -08:00
CGData
CodeGen [DAGTypeLegalizer] Add missing BR_CC handler for soft-promoted half operands (#196214) 2026-05-09 07:04:58 +00:00
CodeGenTypes
DebugInfo [pdb] Fix public symbol hashing in GSIHashStreamBuilder::finalizeBuckets (#190133) 2026-04-10 07:17:18 +00:00
Debuginfod
Demangle
DTLTO [DTLTO][Windows] Expand short 8.3 form paths in ThinLTO module IDs (#178303) 2026-02-18 08:19:19 +00:00
DWARFCFIChecker [DWARF][NFC] Remove unused 'Reads' param from checkCFADiff and checkRegDiff (#174941) 2026-01-09 12:02:22 -05:00
DWARFLinker [llvm][dsymutil] Use the DW_AT_name of the uniqued DIE for insertion into .debug_names (#168513) 2025-11-25 04:15:08 +09:00
DWP [llvm-dwp] Fix FoundCUUnit problem on soft-stop with DWARF5 (#169783) 2025-12-04 10:17:16 +08:00
ExecutionEngine [ELFDebugObjectPlugin] Do not wait for std::future in post-fixup phase in the absent of debug info (#178541) 2026-02-02 09:05:47 +00:00
Extensions [LLVM][NFC] Move PassPlugin from Passes to separate library 2025-12-22 18:11:34 +01:00
FileCheck [NFC][LLVM] Adopt ListSeparator/interleaved in more places (#172909) 2026-01-12 12:18:01 -08:00
Frontend [NFC][LLVM] Adopt ListSeparator/interleaved in more places (#172909) 2026-01-12 12:18:01 -08:00
Fuzzer
FuzzMutate [FuzzerMutate] Allow implicit truncation 2025-12-15 15:44:04 +01:00
InterfaceStub
IR [IR] Use alloc markers for operator delete variants (#138261) 2026-01-22 08:24:43 +00:00
IRPrinter
IRReader [llvm-c] Add LLVMParseIRInContext2 (#174085) 2026-01-08 16:50:05 +00:00
LineEditor
Linker [IRMover] Use signature for exact definition (#177381) 2026-01-29 08:35:31 +00:00
LTO [DTLTO][NFC] Minor improvements to the input file preparation class (#180824) 2026-02-18 08:19:19 +00:00
MC [MC,clang] Fix -Wa,--noexecstack not emitting .note.GNU-stack (#187880) 2026-03-30 15:00:51 +00:00
MCA
ObjCopy [llvm-objcopy] Allow -p on COFF targets (#171237) 2025-12-12 14:48:04 +01:00
Object [llvm-readobj][offload] Fix llvm-readobj --all on MachO (#175912) 2026-01-15 19:38:10 +00:00
ObjectYAML [LLVM][ADT] Migrate users of make_scope_exit to CTAD (#174030) 2026-01-02 20:42:56 -08:00
Option [Option] Use llvm::is_contained (NFC) (#168295) 2025-11-17 07:59:37 -08:00
Passes [LLVM] Successor count added to InstCount (#171670) 2026-01-06 12:41:25 -08:00
Plugins [LLVM][NFC] Move PassPlugin from Passes to separate library 2025-12-22 18:11:34 +01:00
ProfileData [Coverage] Fix quadratic propagation in RawCoverageMappingReader (#194996) 2026-05-01 17:17:20 +00:00
Remarks [LLVM][ADT] Migrate users of make_scope_exit to CTAD (#174030) 2026-01-02 20:42:56 -08:00
SandboxIR [IR] Reland Optimize PHINode::removeIncomingValue() and PHINode::removeIncomingValueIf() to use the swapping strategy. (#174274) 2026-01-04 09:24:53 +08:00
Support [Windows][Support] Add helper to expand short 8.3 form paths (#178480) 2026-02-18 08:19:19 +00:00
TableGen [TableGen] Remove deprecated !getop and !setop (#175155) 2026-01-09 15:16:09 +00:00
Target [WebAssembly] Avoid crash in LateEHPrepare with empty cleanup pads (#200322) 2026-06-01 07:23:32 +00:00
TargetParser [X86][APX] Disable PP2/PPX generation on Windows (#178122) 2026-02-03 09:22:15 +00:00
Telemetry
Testing
TextAPI [llvm] Use llvm::equal (NFC) (#169173) 2025-11-22 15:30:43 -08:00
ToolDrivers
Transforms [CoroSplit] Never collect allocas used by catchpad into frame (#186728) 2026-05-26 08:12:51 +00:00
WindowsDriver
WindowsManifest
XRay
CMakeLists.txt [LLVMABI] Implement the ABI Typesystem (#158329) 2026-01-01 07:52:55 +05:30