mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-01 16:22:41 +00:00
[CodeView] Validate the vftable offset
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271791 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5f57dddf37
commit
667f3f9a9e
@ -1061,8 +1061,12 @@ public:
|
||||
MethodOptions Options = L->Attrs.getFlags();
|
||||
MethodKind MethKind = L->Attrs.getMethodKind();
|
||||
MemberAccess Access = L->Attrs.getAccess();
|
||||
return OneMethodRecord(L->Type, MethKind, Options, Access, VFTableOffset,
|
||||
OneMethodRecord Method(L->Type, MethKind, Options, Access, VFTableOffset,
|
||||
Name);
|
||||
// Validate the vftable offset.
|
||||
if (Method.isIntroducingVirtual() && Method.getVFTableOffset() < 0)
|
||||
return std::make_error_code(std::errc::illegal_byte_sequence);
|
||||
return Method;
|
||||
}
|
||||
|
||||
TypeIndex getType() const { return Type; }
|
||||
@ -1122,6 +1126,11 @@ public:
|
||||
|
||||
Methods.emplace_back(L->Type, MethKind, Options, Access, VFTableOffset,
|
||||
StringRef());
|
||||
|
||||
// Validate the vftable offset.
|
||||
auto &Method = Methods.back();
|
||||
if (Method.isIntroducingVirtual() && Method.getVFTableOffset() < 0)
|
||||
return std::make_error_code(std::errc::illegal_byte_sequence);
|
||||
}
|
||||
return MethodOverloadListRecord(Methods);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user