Changeset 64706 in webkit


Ignore:
Timestamp:
Aug 4, 2010 9:52:25 PM (14 years ago)
Author:
ggaren@apple.com
Message:

JavaScriptCore: https://bugs.webkit.org/show_bug.cgi?id=43461
Invalid NaN parsing

Reviewed by Oliver Hunt and Beth Dakin.

  • wtf/dtoa.cpp: Turn off the dtoa feature that allows you to specify a

non-standard NaN representation, since our NaN encoding assumes that all
true NaNs have the standard bit pattern.

  • API/JSValueRef.cpp:

(JSValueMakeNumber): Don't allow an API client to accidentally specify
a non-standard NaN either.

LayoutTests: https://bugs.webkit.org/show_bug.cgi?id=43461
Crash parsing certain values for NaN

Reviewed by Oliver Hunt and Beth Dakin.

  • fast/js/parse-nan.html: Added.
  • fast/js/script-tests/parse-nan.js: Added.
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSValueRef.cpp

    r59941 r64706  
    214214    APIEntryShim entryShim(exec);
    215215
     216    // Our JSValue representation relies on a standard bit pattern for NaN. NaNs
     217    // generated internally to JavaScriptCore naturally have that representation,
     218    // but an external NaN might not.
     219    if (isnan(value))
     220        value = NaN;
     221
    216222    return toRef(exec, jsNumber(exec, value));
    217223}
  • trunk/JavaScriptCore/ChangeLog

    r64703 r64706  
     12010-08-03  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Reviewed by Oliver Hunt and Beth Dakin.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=43461
     6        Invalid NaN parsing
     7       
     8        * wtf/dtoa.cpp: Turn off the dtoa feature that allows you to specify a
     9        non-standard NaN representation, since our NaN encoding assumes that all
     10        true NaNs have the standard bit pattern.
     11
     12        * API/JSValueRef.cpp:
     13        (JSValueMakeNumber): Don't allow an API client to accidentally specify
     14        a non-standard NaN either.
     15
    1162010-08-04  Gavin Barraclough  <barraclough@apple.com>
    217
  • trunk/JavaScriptCore/wtf/dtoa.cpp

    r60468 r64706  
    168168
    169169#define INFNAN_CHECK
     170#define No_Hex_NaN
    170171
    171172#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(IEEE_ARM) != 1
  • trunk/LayoutTests/ChangeLog

    r64704 r64706  
     12010-08-03  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Reviewed by Oliver Hunt and Beth Dakin.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=43461
     6        Crash parsing certain values for NaN
     7
     8        * fast/js/parse-nan.html: Added.
     9        * fast/js/script-tests/parse-nan.js: Added.
     10
    1112010-08-04  Sheriff Bot  <webkit.review.bot@gmail.com>
    212
Note: See TracChangeset for help on using the changeset viewer.