Merge "Fix vtable boundary check in vndk-vtable-dumper"
This commit is contained in:
@@ -226,7 +226,7 @@ VTable *ELFSharedObject<ELFT>::identifyVTable(uint64_t RelOffset) {
|
|||||||
if (It != mVTables.begin() && It->getStartAddr() != RelOffset) {
|
if (It != mVTables.begin() && It->getStartAddr() != RelOffset) {
|
||||||
It--;
|
It--;
|
||||||
}
|
}
|
||||||
if (It->getEndAddr() >= RelOffset) {
|
if (It->getStartAddr() <= RelOffset && It->getEndAddr() > RelOffset) {
|
||||||
return &(*It);
|
return &(*It);
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -341,7 +341,7 @@ uint64_t ELFSharedObject<ELFT>::identifyAddend(uint64_t ROffset) {
|
|||||||
for (const SectionRef &Section : mProgBitSectionRefs) {
|
for (const SectionRef &Section : mProgBitSectionRefs) {
|
||||||
uint64_t Begin = Section.getAddress();
|
uint64_t Begin = Section.getAddress();
|
||||||
uint64_t End = Section.getAddress() + Section.getSize();
|
uint64_t End = Section.getAddress() + Section.getSize();
|
||||||
if (ROffset >= Begin && ROffset <= End) {
|
if (ROffset >= Begin && ROffset < End) {
|
||||||
return getAddendFromSection(Section, ROffset - Begin);
|
return getAddendFromSection(Section, ROffset - Begin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user