forked from OSchip/llvm-project
Revert "[NFC][scudo] Let disableMemoryTagChecksTestOnly to fail"
This reverts commit 2c212db4ea
.
It's not needed.
This commit is contained in:
parent
9c91614959
commit
d1e5f046cc
|
@ -92,13 +92,12 @@ inline bool systemDetectsMemoryTagFaultsTestOnly() { return false; }
|
|||
|
||||
#endif // SCUDO_LINUX
|
||||
|
||||
inline bool disableMemoryTagChecksTestOnly() {
|
||||
inline void disableMemoryTagChecksTestOnly() {
|
||||
__asm__ __volatile__(
|
||||
R"(
|
||||
.arch_extension memtag
|
||||
msr tco, #1
|
||||
)");
|
||||
return true;
|
||||
}
|
||||
|
||||
inline void enableMemoryTagChecksTestOnly() {
|
||||
|
@ -251,7 +250,7 @@ inline bool systemDetectsMemoryTagFaultsTestOnly() {
|
|||
UNREACHABLE("memory tagging not supported");
|
||||
}
|
||||
|
||||
inline bool disableMemoryTagChecksTestOnly() {
|
||||
inline void disableMemoryTagChecksTestOnly() {
|
||||
UNREACHABLE("memory tagging not supported");
|
||||
}
|
||||
|
||||
|
|
|
@ -399,20 +399,21 @@ SCUDO_TYPED_TEST(ScudoCombinedTest, DisableMemoryTagging) {
|
|||
// Check that disabling memory tagging works correctly.
|
||||
void *P = Allocator->allocate(2048, Origin);
|
||||
EXPECT_DEATH(reinterpret_cast<char *>(P)[2048] = 0xaa, "");
|
||||
if (scudo::disableMemoryTagChecksTestOnly()) {
|
||||
Allocator->disableMemoryTagging();
|
||||
reinterpret_cast<char *>(P)[2048] = 0xaa;
|
||||
Allocator->deallocate(P, Origin);
|
||||
scudo::disableMemoryTagChecksTestOnly();
|
||||
Allocator->disableMemoryTagging();
|
||||
reinterpret_cast<char *>(P)[2048] = 0xaa;
|
||||
Allocator->deallocate(P, Origin);
|
||||
|
||||
P = Allocator->allocate(2048, Origin);
|
||||
EXPECT_EQ(scudo::untagPointer(P), P);
|
||||
reinterpret_cast<char *>(P)[2048] = 0xaa;
|
||||
Allocator->deallocate(P, Origin);
|
||||
P = Allocator->allocate(2048, Origin);
|
||||
EXPECT_EQ(scudo::untagPointer(P), P);
|
||||
reinterpret_cast<char *>(P)[2048] = 0xaa;
|
||||
Allocator->deallocate(P, Origin);
|
||||
|
||||
// Disabling memory tag checks may interfere with subsequent tests.
|
||||
// Re-enable them now.
|
||||
scudo::enableMemoryTagChecksTestOnly();
|
||||
}
|
||||
Allocator->releaseToOS();
|
||||
|
||||
// Disabling memory tag checks may interfere with subsequent tests.
|
||||
// Re-enable them now.
|
||||
scudo::enableMemoryTagChecksTestOnly();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue