Changeset 148130 in webkit


Ignore:
Timestamp:
Apr 10, 2013 1:01:14 PM (11 years ago)
Author:
msaboff@apple.com
Message:

DFG: Negative size for new Array() interpreted as large unsigned int
https://bugs.webkit.org/show_bug.cgi?id=114366

Reviewed by Oliver Hunt.

Source/JavaScriptCore:

Added new check in operationNewArrayWithSize() for a negative
size. If size is negative throw a "RangeError: Array size is not a
small enough positive integer" exception.

  • dfg/DFGOperations.cpp:

LayoutTests:

New test to make sure DFG generated code for new Array() with a
computed negative size throws an exception.

  • fast/js/dfg-negative-array-size-expected.txt: Added.
  • fast/js/dfg-negative-array-size.html: Added.
  • fast/js/script-tests/dfg-negative-array-size.js: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r148121 r148130  
     12013-04-10  Michael Saboff  <msaboff@apple.com>
     2
     3        DFG: Negative size for new Array() interpreted as large unsigned int
     4        https://bugs.webkit.org/show_bug.cgi?id=114366
     5
     6        Reviewed by Oliver Hunt.
     7
     8        New test to make sure DFG generated code for new Array() with a
     9        computed negative size throws an exception.
     10
     11        * fast/js/dfg-negative-array-size-expected.txt: Added.
     12        * fast/js/dfg-negative-array-size.html: Added.
     13        * fast/js/script-tests/dfg-negative-array-size.js: Added.
     14
    1152013-04-10  Robert Hogan  <robert@webkit.org>
    216
  • trunk/Source/JavaScriptCore/ChangeLog

    r148127 r148130  
     12013-04-10  Michael Saboff  <msaboff@apple.com>
     2
     3        DFG: Negative size for new Array() interpreted as large unsigned int
     4        https://bugs.webkit.org/show_bug.cgi?id=114366
     5
     6        Reviewed by Oliver Hunt.
     7
     8        Added new check in operationNewArrayWithSize() for a negative
     9        size.  If size is negative throw a "RangeError: Array size is not a
     10        small enough positive integer" exception.
     11
     12        * dfg/DFGOperations.cpp:
     13
    1142013-04-10  peavo@outlook.com  <peavo@outlook.com>
    215
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r147985 r148130  
    12921292    JSGlobalData* globalData = &exec->globalData();
    12931293    NativeCallFrameTracer tracer(globalData, exec);
    1294    
     1294
     1295    if (size < 0)
     1296        return bitwise_cast<char*>(throwError(exec, createRangeError(exec, ASCIILiteral("Array size is not a small enough positive integer."))));
     1297
    12951298    return bitwise_cast<char*>(JSArray::create(*globalData, arrayStructure, size));
    12961299}
Note: See TracChangeset for help on using the changeset viewer.