Title: [294296] branches/safari-613-branch/Source
Revision
294296
Author
[email protected]
Date
2022-05-16 23:10:38 -0700 (Mon, 16 May 2022)

Log Message

Cherry-pick r293220. rdar://problem/91924480

    Apply purifyNaN in more places.
    https://bugs.webkit.org/show_bug.cgi?id=239619
    <rdar://problem/91924480>

    Reviewed by Yusuke Suzuki.

    Source/_javascript_Core:

    * wasm/js/JSWebAssemblyHelpers.h:
    (JSC::toJSValue):

    Source/WebCore:

    * bindings/js/IDBBindingUtilities.cpp:
    (WebCore::toJS):
    * bindings/js/JSDOMConvertWebGL.cpp:
    (WebCore::convertToJSValue):
    * bindings/js/SerializedScriptValue.cpp:
    (WebCore::CloneDeserializer::readTerminal):
    * bridge/objc/objc_utility.mm:
    (JSC::Bindings::convertObjcValueToValue):

    Canonical link: https://commits.webkit.org/249889@main
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@293220 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-613-branch/Source/_javascript_Core/ChangeLog (294295 => 294296)


--- branches/safari-613-branch/Source/_javascript_Core/ChangeLog	2022-05-17 06:10:33 UTC (rev 294295)
+++ branches/safari-613-branch/Source/_javascript_Core/ChangeLog	2022-05-17 06:10:38 UTC (rev 294296)
@@ -1,3 +1,43 @@
+2022-05-16  Alan Coon  <[email protected]>
+
+        Cherry-pick r293220. rdar://problem/91924480
+
+    Apply purifyNaN in more places.
+    https://bugs.webkit.org/show_bug.cgi?id=239619
+    <rdar://problem/91924480>
+    
+    Reviewed by Yusuke Suzuki.
+    
+    Source/_javascript_Core:
+    
+    * wasm/js/JSWebAssemblyHelpers.h:
+    (JSC::toJSValue):
+    
+    Source/WebCore:
+    
+    * bindings/js/IDBBindingUtilities.cpp:
+    (WebCore::toJS):
+    * bindings/js/JSDOMConvertWebGL.cpp:
+    (WebCore::convertToJSValue):
+    * bindings/js/SerializedScriptValue.cpp:
+    (WebCore::CloneDeserializer::readTerminal):
+    * bridge/objc/objc_utility.mm:
+    (JSC::Bindings::convertObjcValueToValue):
+    
+    Canonical link: https://commits.webkit.org/249889@main
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@293220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-04-22  Mark Lam  <[email protected]>
+
+            Apply purifyNaN in more places.
+            https://bugs.webkit.org/show_bug.cgi?id=239619
+            <rdar://problem/91924480>
+
+            Reviewed by Yusuke Suzuki.
+
+            * wasm/js/JSWebAssemblyHelpers.h:
+            (JSC::toJSValue):
+
 2022-04-29  Alan Coon  <[email protected]>
 
         Cherry-pick r287877. rdar://problem/92357915

Modified: branches/safari-613-branch/Source/_javascript_Core/wasm/js/JSWebAssemblyHelpers.h (294295 => 294296)


--- branches/safari-613-branch/Source/_javascript_Core/wasm/js/JSWebAssemblyHelpers.h	2022-05-17 06:10:33 UTC (rev 294295)
+++ branches/safari-613-branch/Source/_javascript_Core/wasm/js/JSWebAssemblyHelpers.h	2022-05-17 06:10:38 UTC (rev 294296)
@@ -153,7 +153,7 @@
     case Wasm::TypeKind::I32:
         return jsNumber(static_cast<int32_t>(bits));
     case Wasm::TypeKind::F32:
-        return jsNumber(bitwise_cast<float>(static_cast<int32_t>(bits)));
+        return jsNumber(purifyNaN(bitwise_cast<float>(static_cast<int32_t>(bits))));
     case Wasm::TypeKind::F64:
         return jsNumber(bitwise_cast<double>(bits));
     case Wasm::TypeKind::I64:

Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (294295 => 294296)


--- branches/safari-613-branch/Source/WebCore/ChangeLog	2022-05-17 06:10:33 UTC (rev 294295)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog	2022-05-17 06:10:38 UTC (rev 294296)
@@ -1,5 +1,51 @@
 2022-05-16  Alan Coon  <[email protected]>
 
+        Cherry-pick r293220. rdar://problem/91924480
+
+    Apply purifyNaN in more places.
+    https://bugs.webkit.org/show_bug.cgi?id=239619
+    <rdar://problem/91924480>
+    
+    Reviewed by Yusuke Suzuki.
+    
+    Source/_javascript_Core:
+    
+    * wasm/js/JSWebAssemblyHelpers.h:
+    (JSC::toJSValue):
+    
+    Source/WebCore:
+    
+    * bindings/js/IDBBindingUtilities.cpp:
+    (WebCore::toJS):
+    * bindings/js/JSDOMConvertWebGL.cpp:
+    (WebCore::convertToJSValue):
+    * bindings/js/SerializedScriptValue.cpp:
+    (WebCore::CloneDeserializer::readTerminal):
+    * bridge/objc/objc_utility.mm:
+    (JSC::Bindings::convertObjcValueToValue):
+    
+    Canonical link: https://commits.webkit.org/249889@main
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@293220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-04-22  Mark Lam  <[email protected]>
+
+            Apply purifyNaN in more places.
+            https://bugs.webkit.org/show_bug.cgi?id=239619
+            <rdar://problem/91924480>
+
+            Reviewed by Yusuke Suzuki.
+
+            * bindings/js/IDBBindingUtilities.cpp:
+            (WebCore::toJS):
+            * bindings/js/JSDOMConvertWebGL.cpp:
+            (WebCore::convertToJSValue):
+            * bindings/js/SerializedScriptValue.cpp:
+            (WebCore::CloneDeserializer::readTerminal):
+            * bridge/objc/objc_utility.mm:
+            (JSC::Bindings::convertObjcValueToValue):
+
+2022-05-16  Alan Coon  <[email protected]>
+
         Cherry-pick r293170. rdar://problem/91117803
 
     AVSampleBufferRenderSynchronizer timeline sometimes goes backwards when playback begins

Modified: branches/safari-613-branch/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (294295 => 294296)


--- branches/safari-613-branch/Source/WebCore/bindings/js/IDBBindingUtilities.cpp	2022-05-17 06:10:33 UTC (rev 294295)
+++ branches/safari-613-branch/Source/WebCore/bindings/js/IDBBindingUtilities.cpp	2022-05-17 06:10:38 UTC (rev 294296)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2010 Google Inc. All rights reserved.
  * Copyright (C) 2012 Michael Pruett <[email protected]>
- * Copyright (C) 2014-2021 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -179,7 +179,7 @@
         // http://w3c.github.io/IndexedDB/#request-convert-a-key-to-a-value
         RELEASE_AND_RETURN(scope, toJS<IDLNullable<IDLDate>>(lexicalGlobalObject, WallTime::fromRawSeconds(Seconds::fromMilliseconds(key->date()).value())));
     case IndexedDB::KeyType::Number:
-        return jsNumber(key->number());
+        return jsNumber(purifyNaN(key->number()));
     case IndexedDB::KeyType::Min:
     case IndexedDB::KeyType::Max:
     case IndexedDB::KeyType::Invalid:

Modified: branches/safari-613-branch/Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp (294295 => 294296)


--- branches/safari-613-branch/Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp	2022-05-17 06:10:33 UTC (rev 294295)
+++ branches/safari-613-branch/Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp	2022-05-17 06:10:38 UTC (rev 294296)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -91,7 +91,7 @@
         }, [] (long long value) -> JSValue {
             return jsNumber(value);
         }, [] (float value) -> JSValue {
-            return jsNumber(value);
+            return jsNumber(purifyNaN(value));
         }, [&] (const String& value) -> JSValue {
             return jsStringWithCache(lexicalGlobalObject.vm(), value);
         }, [&] (const Vector<bool>& values) -> JSValue {

Modified: branches/safari-613-branch/Source/WebCore/bindings/js/SerializedScriptValue.cpp (294295 => 294296)


--- branches/safari-613-branch/Source/WebCore/bindings/js/SerializedScriptValue.cpp	2022-05-17 06:10:33 UTC (rev 294295)
+++ branches/safari-613-branch/Source/WebCore/bindings/js/SerializedScriptValue.cpp	2022-05-17 06:10:38 UTC (rev 294296)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009-2021 Apple Inc. All rights reserved.
+ * Copyright (C) 2009-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -3544,7 +3544,7 @@
             double d;
             if (!read(d))
                 return JSValue();
-            return jsNumber(d);
+            return jsNumber(purifyNaN(d));
         }
         case BigIntTag:
             return readBigInt();
@@ -3552,7 +3552,7 @@
             double d;
             if (!read(d))
                 return JSValue();
-            NumberObject* obj = constructNumber(m_globalObject, jsNumber(d));
+            NumberObject* obj = constructNumber(m_globalObject, jsNumber(purifyNaN(d)));
             m_gcBuffer.appendWithCrashOnOverflow(obj);
             return obj;
         }

Modified: branches/safari-613-branch/Source/WebCore/bridge/objc/objc_utility.mm (294295 => 294296)


--- branches/safari-613-branch/Source/WebCore/bridge/objc/objc_utility.mm	2022-05-17 06:10:33 UTC (rev 294295)
+++ branches/safari-613-branch/Source/WebCore/bridge/objc/objc_utility.mm	2022-05-17 06:10:38 UTC (rev 294296)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2021 Apple Inc.  All rights reserved.
+ * Copyright (C) 2004-2022 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -238,9 +238,9 @@
         case ObjcUnsignedLongLongType:
             return jsNumber(*(unsigned long long*)buffer);
         case ObjcFloatType:
-            return jsNumber(*(float*)buffer);
+            return jsNumber(purifyNaN(*(float*)buffer));
         case ObjcDoubleType:
-            return jsNumber(*(double*)buffer);
+            return jsNumber(purifyNaN(*(double*)buffer));
         default:
             // Should never get here. Argument types are filtered.
             fprintf(stderr, "%s: invalid type (%d)\n", __PRETTY_FUNCTION__, (int)type);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to