mirror-llvm-project/llvm
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
..
benchmarks
bindings [llvm-c] Add LLVMParseIRInContext2 (#174085) 2026-01-08 16:50:05 +00:00
cmake [cmake] Restore exception flags in llvm-config --cxxflags (#176195) 2026-01-19 10:00:45 +00:00
docs [CoroSplit] Never collect allocas used by catchpad into frame (#186728) 2026-05-26 08:12:51 +00:00
examples [llvm-c] Add LLVMParseIRInContext2 (#174085) 2026-01-08 16:50:05 +00:00
include [DTLTO][Windows] Expand short 8.3 form paths in ThinLTO module IDs (#178303) 2026-02-18 08:19:19 +00:00
lib [WebAssembly] Avoid crash in LateEHPrepare with empty cleanup pads (#200322) 2026-06-01 07:23:32 +00:00
projects
resources
runtimes Revert "[OpenMP] Remove LLVM_ENABLE_PROJECTS=openmp build mode (#152189)" 2026-01-08 13:10:46 +01:00
test [WebAssembly] Avoid crash in LateEHPrepare with empty cleanup pads (#200322) 2026-06-01 07:23:32 +00:00
tools [MC,clang] Fix -Wa,--noexecstack not emitting .note.GNU-stack (#187880) 2026-03-30 15:00:51 +00:00
unittests [AArch64][llvm] Update Armv9.7-A dependencies (#185034) 2026-03-12 23:26:49 +00:00
utils Bump version to 22.1.7 2026-05-19 09:20:09 +00:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [cmake] Make CMAKE_BUILD_TYPE=Release the default (#174520) 2026-01-12 17:18:51 -08:00
CMakePresets.json
configure
CREDITS.TXT
LICENSE.TXT
Maintainers.md [BOLT] Update maintainers list 2026-01-08 13:57:26 -08:00
README.txt
RELEASE_TESTERS.TXT

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.