aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
diff options
context:
space:
mode:
authorDaniil Kovalev <dkovalev@accesssoftek.com>2024-03-02 14:48:46 +0300
committerGitHub <noreply@github.com>2024-03-02 14:48:46 +0300
commitbf08d0286825eb3e482bcfdc1cc7c19a28441ae7 (patch)
tree63f65f6da56478dfa67072981d0f82848278798f /llvm/lib/Bitcode/Reader/MetadataLoader.cpp
parentc4f59937cae95a576635848b36a23b0d672f71d6 (diff)
downloadllvm-bf08d0286825eb3e482bcfdc1cc7c19a28441ae7.zip
llvm-bf08d0286825eb3e482bcfdc1cc7c19a28441ae7.tar.gz
llvm-bf08d0286825eb3e482bcfdc1cc7c19a28441ae7.tar.bz2
Revert "[Dwarf] Support `__ptrauth` qualifier in metadata nodes" (#83672)
Reverts llvm/llvm-project#82363 See a build failure related to an issue discovered by memory sanitizer (use of uninitialized value): https://lab.llvm.org/buildbot/#/builders/37/builds/31965
Diffstat (limited to 'llvm/lib/Bitcode/Reader/MetadataLoader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/MetadataLoader.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
index bdc2db8..770eb83 100644
--- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
@@ -1556,7 +1556,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
break;
}
case bitc::METADATA_DERIVED_TYPE: {
- if (Record.size() < 12 || Record.size() > 15)
+ if (Record.size() < 12 || Record.size() > 14)
return error("Invalid record");
// DWARF address space is encoded as N->getDWARFAddressSpace() + 1. 0 means
@@ -1566,18 +1566,8 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
DWARFAddressSpace = Record[12] - 1;
Metadata *Annotations = nullptr;
- std::optional<DIDerivedType::PtrAuthData> PtrAuthData;
-
- // Only look for annotations/ptrauth if both are allocated.
- // If not, we can't tell which was intended to be embedded, as both ptrauth
- // and annotations have been expected at Record[13] at various times.
- if (Record.size() > 14) {
- if (Record[13])
- Annotations = getMDOrNull(Record[13]);
-
- if (Record[14])
- PtrAuthData = DIDerivedType::PtrAuthData(Record[14]);
- }
+ if (Record.size() > 13 && Record[13])
+ Annotations = getMDOrNull(Record[13]);
IsDistinct = Record[0];
DINode::DIFlags Flags = static_cast<DINode::DIFlags>(Record[10]);
@@ -1587,7 +1577,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
getMDOrNull(Record[3]), Record[4],
getDITypeRefOrNull(Record[5]),
getDITypeRefOrNull(Record[6]), Record[7], Record[8],
- Record[9], DWARFAddressSpace, PtrAuthData, Flags,
+ Record[9], DWARFAddressSpace, Flags,
getDITypeRefOrNull(Record[11]), Annotations)),
NextMetadataNo);
NextMetadataNo++;