Changeset 62456 in webkit for trunk/JavaScriptCore/interpreter


Ignore:
Timestamp:
Jul 3, 2010, 4:49:59 PM (15 years ago)
Author:
Darin Adler
Message:

2010-07-03 Yong Li <[email protected]>

Reviewed by Darin Adler.

Make Arguments::MaxArguments clamping work for numbers >= 0x80000000 in
the interpreter as well as the JIT.

https://bugs.webkit.org/show_bug.cgi?id=41351
rdar://problem/8142141

  • interpreter/Interpreter.cpp: (JSC::Interpreter::privateExecute): Fix signed integer overflow problem in op_load_varargs handling. 0xFFFFFFFF was read as -1.

2010-07-03 Darin Adler <Darin Adler>

Added test cases for edge cases in apply function on arrays.
https://bugs.webkit.org/show_bug.cgi?id=41351

  • fast/js/function-apply-expected.txt: Updated to expect success.
  • fast/js/script-tests/function-apply.js: Added test cases.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/interpreter/Interpreter.cpp

    r62432 r62456  
    11/*
    2  * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
     2 * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved.
    33 * Copyright (C) 2008 Cameron Zwarich <[email protected]>
    44 *
     
    36943694       
    36953695        JSValue arguments = callFrame->r(argsOffset).jsValue();
    3696         int32_t argCount = 0;
     3696        uint32_t argCount = 0;
    36973697        if (!arguments) {
    36983698            argCount = (uint32_t)(callFrame->argumentCount());
    3699             argCount = min(argCount, static_cast<int32_t>(Arguments::MaxArguments));
     3699            argCount = min<uint32_t>(argCount, Arguments::MaxArguments);
    37003700            int32_t sizeDelta = argsOffset + argCount + RegisterFile::CallFrameHeaderSize;
    37013701            Register* newEnd = callFrame->registers() + sizeDelta;
     
    37243724                Arguments* args = asArguments(arguments);
    37253725                argCount = args->numProvidedArguments(callFrame);
    3726                 argCount = min(argCount, static_cast<int32_t>(Arguments::MaxArguments));
     3726                argCount = min<uint32_t>(argCount, Arguments::MaxArguments);
    37273727                int32_t sizeDelta = argsOffset + argCount + RegisterFile::CallFrameHeaderSize;
    37283728                Register* newEnd = callFrame->registers() + sizeDelta;
     
    37353735                JSArray* array = asArray(arguments);
    37363736                argCount = array->length();
    3737                 argCount = min(argCount, static_cast<int32_t>(Arguments::MaxArguments));
     3737                argCount = min<uint32_t>(argCount, Arguments::MaxArguments);
    37383738                int32_t sizeDelta = argsOffset + argCount + RegisterFile::CallFrameHeaderSize;
    37393739                Register* newEnd = callFrame->registers() + sizeDelta;
     
    37463746                JSObject* argObject = asObject(arguments);
    37473747                argCount = argObject->get(callFrame, callFrame->propertyNames().length).toUInt32(callFrame);
    3748                 argCount = min(argCount, static_cast<int32_t>(Arguments::MaxArguments));
     3748                argCount = min<uint32_t>(argCount, Arguments::MaxArguments);
    37493749                int32_t sizeDelta = argsOffset + argCount + RegisterFile::CallFrameHeaderSize;
    37503750                Register* newEnd = callFrame->registers() + sizeDelta;
Note: See TracChangeset for help on using the changeset viewer.