apple / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. This fork is used to manage Apple’s stable releases of Clang as well as support the Swift project.
https://llvm.org
Other
1.1k stars 320 forks source link

[clang] Fix a crash when a variable is captured by a block nested inside a lambda #8825

Closed ahatanaka closed 1 month ago

ahatanaka commented 1 month ago

Eval->Value.get returns a null pointer when the variable doesn't have an initializer. Use cast_if_present instead of cast.

This fixes https://github.com/llvm/llvm-project/issues/93625.

rdar://128482541 (cherry picked from commit e1c3e16d24b5cc097ff08e9283f53319acd3f245)

Conflicts: clang/docs/ReleaseNotes.rst