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

Changeset 242114 in webkit


Ignore:
Timestamp:
Feb 26, 2019, 4:25:34 PM (8 years ago)
Author:
mark.lam@apple.com
Message:

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):

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r242081 r242114  
     12019-02-26  Mark Lam  <mark.lam@apple.com>
     2
     3        wasmToJS() should purify incoming NaNs.
     4        https://bugs.webkit.org/show_bug.cgi?id=194807
     5        <rdar://problem/48189132>
     6
     7        Reviewed by Saam Barati.
     8
     9        * wasm/regress/wasmToJS-should-purify-NaNs.js: Added.
     10
    1112019-02-26  Guillaume Emont  <guijemont@igalia.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r242109 r242114  
     12019-02-26  Mark Lam  <mark.lam@apple.com>
     2
     3        wasmToJS() should purify incoming NaNs.
     4        https://bugs.webkit.org/show_bug.cgi?id=194807
     5        <rdar://problem/48189132>
     6
     7        Reviewed by Saam Barati.
     8
     9        * runtime/JSCJSValue.h:
     10        (JSC::jsNumber):
     11        * runtime/TypedArrayAdaptors.h:
     12        (JSC::IntegralTypedArrayAdaptor::toJSValue):
     13        * wasm/js/WasmToJS.cpp:
     14        (JSC::Wasm::wasmToJS):
     15
    1162019-02-26  Dominik Infuehr  <dinfuehr@igalia.com>
    217
  • trunk/Source/JavaScriptCore/runtime/JSCJSValue.h

    r239427 r242114  
    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}
  • trunk/Source/JavaScriptCore/runtime/TypedArrayAdaptors.h

    r239427 r242114  
    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    }
  • trunk/Source/JavaScriptCore/wasm/js/WasmToJS.cpp

    r240543 r242114  
    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.