[NFC][scudo] Let disableMemoryTagChecksTestOnly to fail

If this happend we can't run corresponding test.

GitOrigin-RevId: 2c212db4ea42fbbc0e83647da4f62261f775388b
diff --git a/memtag.h b/memtag.h
index 4bdce16..cf1ec3b 100644
--- a/memtag.h
+++ b/memtag.h
@@ -92,12 +92,13 @@
 
 #endif // SCUDO_LINUX
 
-inline void disableMemoryTagChecksTestOnly() {
+inline bool disableMemoryTagChecksTestOnly() {
   __asm__ __volatile__(
       R"(
       .arch_extension memtag
       msr tco, #1
       )");
+  return true;
 }
 
 inline void enableMemoryTagChecksTestOnly() {
@@ -244,7 +245,7 @@
   UNREACHABLE("memory tagging not supported");
 }
 
-inline void disableMemoryTagChecksTestOnly() {
+inline bool disableMemoryTagChecksTestOnly() {
   UNREACHABLE("memory tagging not supported");
 }
 
diff --git a/tests/combined_test.cpp b/tests/combined_test.cpp
index 50602ef..619a94c 100644
--- a/tests/combined_test.cpp
+++ b/tests/combined_test.cpp
@@ -380,21 +380,20 @@
     // Check that disabling memory tagging works correctly.
     void *P = Allocator->allocate(2048, Origin);
     EXPECT_DEATH(reinterpret_cast<char *>(P)[2048] = 0xaa, "");
-    scudo::disableMemoryTagChecksTestOnly();
-    Allocator->disableMemoryTagging();
-    reinterpret_cast<char *>(P)[2048] = 0xaa;
-    Allocator->deallocate(P, Origin);
+    if (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);
 
-    Allocator->releaseToOS();
-
-    // Disabling memory tag checks may interfere with subsequent tests.
-    // Re-enable them now.
-    scudo::enableMemoryTagChecksTestOnly();
+      // Disabling memory tag checks may interfere with subsequent tests.
+      // Re-enable them now.
+      scudo::enableMemoryTagChecksTestOnly();
+    }
   }
 }