Title: [250695] trunk/Source/_javascript_Core
Revision
250695
Author
[email protected]
Date
2019-10-03 18:26:26 -0700 (Thu, 03 Oct 2019)

Log Message

Fix testmasm failure on ASan builds.
https://bugs.webkit.org/show_bug.cgi?id=202554

Reviewed by Yusuke Suzuki.

Gigacage is disabled on ASan builds.  So testmasm is sad.  Make the relevant test
bail gracefully if Gigacage should be disabled.

Also converted some ASSERTs into RELEASE_ASSERTs.  This is a test.  No reason to
not assert always.

* assembler/testmasm.cpp:
(JSC::testCagePreservesPACFailureBit):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (250694 => 250695)


--- trunk/Source/_javascript_Core/ChangeLog	2019-10-04 01:09:43 UTC (rev 250694)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-10-04 01:26:26 UTC (rev 250695)
@@ -1,3 +1,19 @@
+2019-10-03  Mark Lam  <[email protected]>
+
+        Fix testmasm failure on ASan builds.
+        https://bugs.webkit.org/show_bug.cgi?id=202554
+
+        Reviewed by Yusuke Suzuki.
+
+        Gigacage is disabled on ASan builds.  So testmasm is sad.  Make the relevant test
+        bail gracefully if Gigacage should be disabled.
+
+        Also converted some ASSERTs into RELEASE_ASSERTs.  This is a test.  No reason to
+        not assert always.
+
+        * assembler/testmasm.cpp:
+        (JSC::testCagePreservesPACFailureBit):
+
 2019-10-03  Ross Kirsling  <[email protected]>
 
         Socket RWI client should acquire backend commands from server

Modified: trunk/Source/_javascript_Core/assembler/testmasm.cpp (250694 => 250695)


--- trunk/Source/_javascript_Core/assembler/testmasm.cpp	2019-10-04 01:09:43 UTC (rev 250694)
+++ trunk/Source/_javascript_Core/assembler/testmasm.cpp	2019-10-04 01:26:26 UTC (rev 250695)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -1210,7 +1210,11 @@
 static void testCagePreservesPACFailureBit()
 {
 #if GIGACAGE_ENABLED
-    ASSERT(!Gigacage::isDisablingPrimitiveGigacageForbidden());
+    // Placate ASan builds and any environments that disables the Gigacage.
+    if (!Gigacage::shouldBeEnabled())
+        return;
+
+    RELEASE_ASSERT(!Gigacage::isDisablingPrimitiveGigacageForbidden());
     auto cage = compile([] (CCallHelpers& jit) {
         emitFunctionPrologue(jit);
         jit.cageConditionally(Gigacage::Primitive, GPRInfo::argumentGPR0, GPRInfo::argumentGPR1, GPRInfo::argumentGPR2);
@@ -1221,7 +1225,7 @@
 
     void* ptr = Gigacage::tryMalloc(Gigacage::Primitive, 1);
     void* taggedPtr = tagArrayPtr(ptr, 1);
-    ASSERT(hasOneBitSet(Gigacage::size(Gigacage::Primitive) << 2));
+    RELEASE_ASSERT(hasOneBitSet(Gigacage::size(Gigacage::Primitive) << 2));
     void* notCagedPtr = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(ptr) + (Gigacage::size(Gigacage::Primitive) << 2));
     CHECK_NOT_EQ(Gigacage::caged(Gigacage::Primitive, notCagedPtr), notCagedPtr);
     void* taggedNotCagedPtr = tagArrayPtr(notCagedPtr, 1);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to