diff options
author | gbMattN <matthew.nagy@sony.com> | 2025-06-27 11:43:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-27 11:43:24 +0100 |
commit | 0158ca21a23b0cef0a9921e6885cd2b95fef2678 (patch) | |
tree | 862327852e3f39cd6607965093d08ab186295aed /llvm/lib/IR/DebugInfo.cpp | |
parent | 793667017c64292ced87fe63e0b7217d6f6688b6 (diff) | |
download | llvm-0158ca21a23b0cef0a9921e6885cd2b95fef2678.zip llvm-0158ca21a23b0cef0a9921e6885cd2b95fef2678.tar.gz llvm-0158ca21a23b0cef0a9921e6885cd2b95fef2678.tar.bz2 |
Prevent a crash when a global variable has debug metadata (#145918)
This patch fixes a crash I found when trying to compile some codebases
with -fsanitize=type and -g
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 5c645ff..ecb19fd 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -50,7 +50,7 @@ TinyPtrVector<DbgDeclareInst *> llvm::findDbgDeclares(Value *V) { // DenseMap lookup. This check is a bitfield datamember lookup. if (!V->isUsedByMetadata()) return {}; - auto *L = LocalAsMetadata::getIfExists(V); + auto *L = ValueAsMetadata::getIfExists(V); if (!L) return {}; auto *MDV = MetadataAsValue::getIfExists(V->getContext(), L); @@ -69,7 +69,7 @@ TinyPtrVector<DbgVariableRecord *> llvm::findDVRDeclares(Value *V) { // DenseMap lookup. This check is a bitfield datamember lookup. if (!V->isUsedByMetadata()) return {}; - auto *L = LocalAsMetadata::getIfExists(V); + auto *L = ValueAsMetadata::getIfExists(V); if (!L) return {}; @@ -86,7 +86,7 @@ TinyPtrVector<DbgVariableRecord *> llvm::findDVRValues(Value *V) { // DenseMap lookup. This check is a bitfield datamember lookup. if (!V->isUsedByMetadata()) return {}; - auto *L = LocalAsMetadata::getIfExists(V); + auto *L = ValueAsMetadata::getIfExists(V); if (!L) return {}; |