[CodeView] Avoid NULL deref of Scope
authorMike Hommey <mh@glandium.org>
Fri, 7 Oct 2022 06:34:05 +0000 (08:34 +0200)
committerSylvestre Ledru <sylvestre@debian.org>
Fri, 7 Oct 2022 06:34:57 +0000 (08:34 +0200)
commitd3b0e745e8a3ead8cc2f0cc246c19c13f0c35ebb
tree36e2e3f1ee0cf650a74e2f5cc21874bbc4d3cacd
parenta64ea173d7b152678780d5443407d1071277642b
[CodeView] Avoid NULL deref of Scope

Regression from D131400: cross-language LTO causes a crash in the
compiler on the NULL deref of Scope in `isa` call when Rust IR is
involved. Presumably, this might affect other languages too, and
even Rust itself without cross-language LTO when the Rust compiler
switched to LLVM 16.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D134616
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
llvm/test/DebugInfo/COFF/global_rust.ll [new file with mode: 0644]