mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-12 15:30:56 +00:00
ProfileData: Avoid UB when reading
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206674 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1907b94222
commit
e382065b82
@ -222,8 +222,9 @@ public:
|
||||
static std::pair<offset_type, offset_type>
|
||||
ReadKeyDataLength(const unsigned char *&D) {
|
||||
using namespace support;
|
||||
return std::make_pair(endian::readNext<offset_type, little, unaligned>(D),
|
||||
endian::readNext<offset_type, little, unaligned>(D));
|
||||
offset_type KeyLen = endian::readNext<offset_type, little, unaligned>(D);
|
||||
offset_type DataLen = endian::readNext<offset_type, little, unaligned>(D);
|
||||
return std::make_pair(KeyLen, DataLen);
|
||||
}
|
||||
|
||||
StringRef ReadKey(const unsigned char *D, unsigned N) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user