mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
InstrProf: Change magic number to have non-text characters
Include non-text characters in the magic number so that text files can't match. <rdar://problem/15950346> llvm-svn: 204513
This commit is contained in:
parent
1afa51c6d0
commit
091c8253f5
@ -90,14 +90,14 @@ RawInstrProfReader::RawInstrProfReader(std::unique_ptr<MemoryBuffer> DataBuffer)
|
|||||||
|
|
||||||
static uint64_t getRawMagic() {
|
static uint64_t getRawMagic() {
|
||||||
return
|
return
|
||||||
uint64_t('l') << 56 |
|
uint64_t(255) << 56 |
|
||||||
uint64_t('p') << 48 |
|
uint64_t('l') << 48 |
|
||||||
uint64_t('r') << 40 |
|
uint64_t('p') << 40 |
|
||||||
uint64_t('o') << 32 |
|
uint64_t('r') << 32 |
|
||||||
uint64_t('f') << 24 |
|
uint64_t('o') << 24 |
|
||||||
uint64_t('r') << 16 |
|
uint64_t('f') << 16 |
|
||||||
uint64_t('a') << 8 |
|
uint64_t('r') << 8 |
|
||||||
uint64_t('w');
|
uint64_t(129);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RawInstrProfReader::hasFormat(const MemoryBuffer &DataBuffer) {
|
bool RawInstrProfReader::hasFormat(const MemoryBuffer &DataBuffer) {
|
||||||
|
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
RUN: printf "warforpl" > %t
|
RUN: printf '\201rforpl\377' > %t
|
||||||
RUN: not llvm-profdata show %t 2>&1 | FileCheck %s
|
RUN: not llvm-profdata show %t 2>&1 | FileCheck %s
|
||||||
RUN: printf "lprofraw" > %t
|
RUN: printf '\377lprofr\201' > %t
|
||||||
RUN: not llvm-profdata show %t 2>&1 | FileCheck %s
|
RUN: not llvm-profdata show %t 2>&1 | FileCheck %s
|
||||||
|
|
||||||
CHECK: error: {{.+}}: Invalid header
|
CHECK: error: {{.+}}: Invalid header
|
||||||
|
Loading…
Reference in New Issue
Block a user