[Webkit-unassigned] [Bug 140093] New: Argument object created by "Function dot arguments" should be a clone of argument values

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 5 13:07:04 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=140093

            Bug ID: 140093
           Summary: Argument object created by "Function dot arguments"
                    should be a clone of argument values
    Classification: Unclassified
           Product: WebKit
           Version: 528+ (Nightly build)
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mark.lam at apple.com

After https://bugs.webkit.org/show_bug.cgi?id=139827, a few test failures will start failing.  One of them is dfg-tear-off-arguments-not-activation.js, which can be run this way:

$ jsc --useFTLJIT\=false --enableFunctionDotArguments\=true --testTheFTL\=true --useFTLJIT\=true resources/standalone-pre.js dfg-tear-off-arguments-not-activation.js resources/standalone-post.js

The relevant code is as follows:

    function bar() {
        return foo.arguments;
    }

    function foo(p) {
        var x = 42;
        if (p)
            return (function() { return x; });
        else
            return bar();
    }

In this case, foo() has no knowledge of bar() needing the LexicalEnvironment and has dead code eliminated the SetLocal that stores it into its designated local.  In bar(), the factory for the Arguments object (for creating foo.arguments) tries to read foo's LexicalEnvironment from its designated lexicalEnvironment local, but instead, finds it to be uninitialized.  This results in a null pointer access which causes a crash.

This can be resolved by having bar() instantiate a clone of the Arguments object instead, and populate its elements with values fetched directly from foo's frame.  There's no need to reference foo's LexicalEnvironment (whether present or not).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150105/e0a5bbe5/attachment-0002.html>


More information about the webkit-unassigned mailing list