[Lldb-commits] [PATCH] D146536: SymbolFile: ensure that we have a value before invoking `getBitWidth`

Saleem Abdulrasool via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 22 11:14:33 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG16b7cf245ec0: SymbolFile: ensure that we have a value before invoking `getBitWidth` (authored by compnerd).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146536/new/

https://reviews.llvm.org/D146536

Files:
  lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp


Index: lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
+++ lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
@@ -1299,6 +1299,15 @@
       // Query the symbol's value as the variable initializer if valid.
       if (member_comp_type.IsConst()) {
         auto value = member->getValue();
+        if (value.Type == llvm::pdb::Empty) {
+          LLDB_LOG(GetLog(LLDBLog::AST),
+                   "Class '{0}' has member '{1}' of type '{2}' with an unknown "
+                   "constant size.",
+                   record_type.GetTypeName(), member_name,
+                   member_comp_type.GetTypeName());
+          continue;
+        }
+
         clang::QualType qual_type = decl->getType();
         unsigned type_width = m_ast.getASTContext().getIntWidth(qual_type);
         unsigned constant_width = value.getBitWidth();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146536.507437.patch
Type: text/x-patch
Size: 961 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230322/1b7f5981/attachment.bin>


More information about the lldb-commits mailing list