REGRESSION: wasm.yaml/wasm/js-api/dont-mmap-zero-byte-memory.js failing on JSC Debug...
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Aug 2017 07:03:06 +0000 (07:03 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Aug 2017 07:03:06 +0000 (07:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=175256

Reviewed by Saam Barati.

The check in createFromBytes just needed to check that the buffer was not null before
calling isCaged.

* runtime/ArrayBuffer.cpp:
(JSC::ArrayBuffer::createFromBytes):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220330 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/ArrayBuffer.cpp

index 57b9f25..58774fc 100644 (file)
@@ -1,3 +1,16 @@
+2017-08-07  Keith Miller  <keith_miller@apple.com>
+
+        REGRESSION: wasm.yaml/wasm/js-api/dont-mmap-zero-byte-memory.js failing on JSC Debug bots
+        https://bugs.webkit.org/show_bug.cgi?id=175256
+
+        Reviewed by Saam Barati.
+
+        The check in createFromBytes just needed to check that the buffer was not null before
+        calling isCaged.
+
+        * runtime/ArrayBuffer.cpp:
+        (JSC::ArrayBuffer::createFromBytes):
+
 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK][WPE] Add API to provide browser information required by automation
index 19191d9..6add4ce 100644 (file)
@@ -198,7 +198,7 @@ Ref<ArrayBuffer> ArrayBuffer::createAdopted(const void* data, unsigned byteLengt
 // - WebAssembly. Wasm should allocate from the cage.
 Ref<ArrayBuffer> ArrayBuffer::createFromBytes(const void* data, unsigned byteLength, ArrayBufferDestructorFunction&& destructor)
 {
-    if (!Gigacage::isCaged(data) && data && byteLength)
+    if (data && byteLength && !Gigacage::isCaged(data))
         Gigacage::disableGigacage();
     
     ArrayBufferContents contents(const_cast<void*>(data), byteLength, WTFMove(destructor));