Skip to content

Commit 6be3cc5

Browse files
authored
[LLDB][NativePDB] Fix name access for classes in CVTagRecord::name (#151190)
From #149876 (comment): The `name()` accessor checked for `m_kind == Union` and accessed `cvclass` instead of `cvunion`. This is technically wrong (maybe UB even?). In practice, this wasn't an issue, because all types in the union (`ClassRecord`/`EnumRecord`/`UnionRecord`) inherit from `TagRecord`.
1 parent 9a84c62 commit 6be3cc5

File tree

1 file changed

+1
-1
lines changed
  • lldb/source/Plugins/SymbolFile/NativePDB

1 file changed

+1
-1
lines changed

lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct CVTagRecord {
6565
}
6666

6767
llvm::StringRef name() const {
68-
if (m_kind == Struct || m_kind == Union)
68+
if (m_kind == Struct || m_kind == Class)
6969
return cvclass.Name;
7070
if (m_kind == Enum)
7171
return cvenum.Name;

0 commit comments

Comments
 (0)