⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 242854 in webkit


Ignore:
Timestamp:
Mar 13, 2019, 1:24:29 AM (7 years ago)
Author:
bshafiei@apple.com
Message:

Cherry-pick r242114. rdar://problem/48839372

wasmToJS() should purify incoming NaNs.
https://bugs.webkit.org/show_bug.cgi?id=194807
<rdar://problem/48189132>

Reviewed by Saam Barati.

JSTests:

  • wasm/regress/wasmToJS-should-purify-NaNs.js: Added.

Source/JavaScriptCore:

  • runtime/JSCJSValue.h: (JSC::jsNumber):
  • runtime/TypedArrayAdaptors.h: (JSC::IntegralTypedArrayAdaptor::toJSValue):
  • wasm/js/WasmToJS.cpp: (JSC::Wasm::wasmToJS):

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

Location:
branches/safari-607-branch
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-607-branch/JSTests/ChangeLog

    r242852 r242854  
     12019-03-13  Babak Shafiei  <bshafiei@apple.com>
     2
     3        Cherry-pick r242114. rdar://problem/48839372
     4
     5    wasmToJS() should purify incoming NaNs.
     6    https://bugs.webkit.org/show_bug.cgi?id=194807
     7    <rdar://problem/48189132>
     8   
     9    Reviewed by Saam Barati.
     10   
     11    JSTests:
     12   
     13    * wasm/regress/wasmToJS-should-purify-NaNs.js: Added.
     14   
     15    Source/JavaScriptCore:
     16   
     17    * runtime/JSCJSValue.h:
     18    (JSC::jsNumber):
     19    * runtime/TypedArrayAdaptors.h:
     20    (JSC::IntegralTypedArrayAdaptor::toJSValue):
     21    * wasm/js/WasmToJS.cpp:
     22    (JSC::Wasm::wasmToJS):
     23   
     24   
     25   
     26    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     27
     28    2019-02-26  Mark Lam  <mark.lam@apple.com>
     29
     30            wasmToJS() should purify incoming NaNs.
     31            https://bugs.webkit.org/show_bug.cgi?id=194807
     32            <rdar://problem/48189132>
     33
     34            Reviewed by Saam Barati.
     35
     36            * wasm/regress/wasmToJS-should-purify-NaNs.js: Added.
     37
    1382019-03-13  Babak Shafiei  <bshafiei@apple.com>
    239
  • branches/safari-607-branch/Source/JavaScriptCore/ChangeLog

    r242852 r242854  
     12019-03-13  Babak Shafiei  <bshafiei@apple.com>
     2
     3        Cherry-pick r242114. rdar://problem/48839372
     4
     5    wasmToJS() should purify incoming NaNs.
     6    https://bugs.webkit.org/show_bug.cgi?id=194807
     7    <rdar://problem/48189132>
     8   
     9    Reviewed by Saam Barati.
     10   
     11    JSTests:
     12   
     13    * wasm/regress/wasmToJS-should-purify-NaNs.js: Added.
     14   
     15    Source/JavaScriptCore:
     16   
     17    * runtime/JSCJSValue.h:
     18    (JSC::jsNumber):
     19    * runtime/TypedArrayAdaptors.h:
     20    (JSC::IntegralTypedArrayAdaptor::toJSValue):
     21    * wasm/js/WasmToJS.cpp:
     22    (JSC::Wasm::wasmToJS):
     23   
     24   
     25   
     26    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     27
     28    2019-02-26  Mark Lam  <mark.lam@apple.com>
     29
     30            wasmToJS() should purify incoming NaNs.
     31            https://bugs.webkit.org/show_bug.cgi?id=194807
     32            <rdar://problem/48189132>
     33
     34            Reviewed by Saam Barati.
     35
     36            * runtime/JSCJSValue.h:
     37            (JSC::jsNumber):
     38            * runtime/TypedArrayAdaptors.h:
     39            (JSC::IntegralTypedArrayAdaptor::toJSValue):
     40            * wasm/js/WasmToJS.cpp:
     41            (JSC::Wasm::wasmToJS):
     42
    1432019-03-13  Babak Shafiei  <bshafiei@apple.com>
    244
  • branches/safari-607-branch/Source/JavaScriptCore/runtime/JSCJSValue.h

    r239427 r242854  
    22 *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
    33 *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
    4  *  Copyright (C) 2003-2018 Apple Inc. All rights reserved.
     4 *  Copyright (C) 2003-2019 Apple Inc. All rights reserved.
    55 *
    66 *  This library is free software; you can redistribute it and/or
     
    2424
    2525#include "JSExportMacros.h"
     26#include "PureNaN.h"
    2627#include <functional>
    2728#include <math.h>
     
    549550{
    550551    ASSERT(JSValue(d).isNumber());
     552    ASSERT(!isImpureNaN(d));
    551553    return JSValue(d);
    552554}
  • branches/safari-607-branch/Source/JavaScriptCore/runtime/TypedArrayAdaptors.h

    r239427 r242854  
    11/*
    2  * Copyright (C) 2013 Apple Inc. All rights reserved.
     2 * Copyright (C) 2013-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4646    static JSValue toJSValue(Type value)
    4747    {
     48        static_assert(!std::is_floating_point<Type>::value, "");
    4849        return jsNumber(value);
    4950    }
  • branches/safari-607-branch/Source/JavaScriptCore/wasm/js/WasmToJS.cpp

    r235786 r242854  
    11/*
    2  * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    250250                    case F32:
    251251                    case F64:
    252                         arg = jsNumber(bitwise_cast<double>(buffer[argNum]));
     252                        arg = jsNumber(purifyNaN(bitwise_cast<double>(buffer[argNum])));
    253253                        break;
    254254                    }
Note: See TracChangeset for help on using the changeset viewer.