From 03c3511211623f7750f11eeba62f906ab7a41c39 Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Sat, 10 Sep 2016 06:15:26 +0000 Subject: [PATCH] [LTO] Handle null GV in Symbol object Similar to other Symbol methods, have Symbol::getComdat handle a null GV gracefully. Fixes PR30326. llvm-svn: 281134 --- llvm/include/llvm/LTO/LTO.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/include/llvm/LTO/LTO.h b/llvm/include/llvm/LTO/LTO.h index d5f3b12cc8e7..5b684bd1c904 100644 --- a/llvm/include/llvm/LTO/LTO.h +++ b/llvm/include/llvm/LTO/LTO.h @@ -165,6 +165,8 @@ public: return GV && llvm::canBeOmittedFromSymbolTable(GV); } Expected getComdat() const { + if (!GV) + return nullptr; const GlobalObject *GO; if (auto *GA = dyn_cast(GV)) { GO = GA->getBaseObject();