-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Dwarf] Support __ptrauth
qualifier in metadata nodes
#83862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
448c908
d7a14d7
ff2494b
57e86f6
32e43df
06a0bc4
0d17f23
4549649
f765247
4c7bdcb
1adcade
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1556,7 +1556,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( | |
break; | ||
} | ||
case bitc::METADATA_DERIVED_TYPE: { | ||
if (Record.size() < 12 || Record.size() > 14) | ||
if (Record.size() < 12 || Record.size() > 15) | ||
return error("Invalid record"); | ||
|
||
// DWARF address space is encoded as N->getDWARFAddressSpace() + 1. 0 means | ||
|
@@ -1566,8 +1566,17 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( | |
DWARFAddressSpace = Record[12] - 1; | ||
|
||
Metadata *Annotations = nullptr; | ||
if (Record.size() > 13 && Record[13]) | ||
Annotations = getMDOrNull(Record[13]); | ||
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]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This if is redundant? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deleting this does not break any tests. However, even w/o this patch, when we had the code below, deleting check against
So, there are either no test cases which check that or the |
||
Annotations = getMDOrNull(Record[13]); | ||
if (Record[14]) | ||
PtrAuthData.emplace(Record[14]); | ||
} | ||
|
||
IsDistinct = Record[0]; | ||
DINode::DIFlags Flags = static_cast<DINode::DIFlags>(Record[10]); | ||
|
@@ -1577,7 +1586,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( | |
getMDOrNull(Record[3]), Record[4], | ||
getDITypeRefOrNull(Record[5]), | ||
getDITypeRefOrNull(Record[6]), Record[7], Record[8], | ||
Record[9], DWARFAddressSpace, Flags, | ||
Record[9], DWARFAddressSpace, PtrAuthData, Flags, | ||
getDITypeRefOrNull(Record[11]), Annotations)), | ||
NextMetadataNo); | ||
NextMetadataNo++; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add comment describing the layout of
RawData
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks, see f765247