Bug 160671 - Parser<LexerType>::parseFunctionInfo() has the wrong info about captured vars when a function is not cached.
Summary: Parser<LexerType>::parseFunctionInfo() has the wrong info about captured vars...
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
Keywords: InRadar
Depends on:
Reported: 2016-08-08 15:59 PDT by Mark Lam
Modified: 2016-08-09 15:05 PDT (History)
8 users (show)

See Also:

Repro test case. (298 bytes, application/x-javascript)
2016-08-08 15:59 PDT, Mark Lam
no flags Details
patch (5.54 KB, patch)
2016-08-09 13:28 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2016-08-08 15:59:53 PDT
Created attachment 285595 [details]
Repro test case.

Steps to repro:

1. Apply the following patch to disable the function cache.

Index: Source/JavaScriptCore/parser/Parser.cpp
--- Source/JavaScriptCore/parser/Parser.cpp     (revision 204127)
+++ Source/JavaScriptCore/parser/Parser.cpp     (working copy)
@@ -1954,6 +1954,7 @@ template <class TreeBuilder> bool Parser
     FunctionBodyType functionBodyType;
     auto loadCachedFunction = [&] () -> bool {
+        if (true) return false;
         ASSERT(parametersStart != -1);
         ASSERT(startColumn != -1);
2. Run jsc on the attached test case.

It ends up throwing the following invalid error:

Exception: ReferenceError: Can't find variable: inner
global code@/Volumes/Data/objcjsc/tests/test.js:15:3
Comment 1 Radar WebKit Bug Importer 2016-08-08 16:01:12 PDT
Comment 2 Saam Barati 2016-08-09 13:28:21 PDT
Created attachment 285666 [details]
Comment 3 Mark Lam 2016-08-09 13:42:03 PDT
Comment on attachment 285666 [details]

Comment 4 WebKit Commit Bot 2016-08-09 15:04:56 PDT
Comment on attachment 285666 [details]

Clearing flags on attachment: 285666

Committed r204305: <http://trac.webkit.org/changeset/204305>
Comment 5 WebKit Commit Bot 2016-08-09 15:05:00 PDT
All reviewed patches have been landed.  Closing bug.