Bug 20293 - Crash in JavaScript codegen for eval("const a;")
Summary: Crash in JavaScript codegen for eval("const a;")
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P1 Normal
Assignee: Nobody
Depends on:
Reported: 2008-08-05 17:05 PDT by Cameron Zwarich (cpst)
Modified: 2008-08-05 17:42 PDT (History)
3 users (show)

See Also:

Stack trace (3.71 KB, text/plain)
2008-08-05 17:14 PDT, Cameron Zwarich (cpst)
no flags Details
Proposed patch (2.87 KB, patch)
2008-08-05 17:29 PDT, Cameron Zwarich (cpst)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron Zwarich (cpst) 2008-08-05 17:05:59 PDT
Executing eval("const a;") crashes WebKit, both in the JS shell and in the browser.
Comment 1 Cameron Zwarich (cpst) 2008-08-05 17:14:00 PDT
Created attachment 22666 [details]
Stack trace

The reason for the crash is pretty obvious. The eval path assumes that there is an initializer. I'll change it so it returns undefined otherwise.
Comment 2 Cameron Zwarich (cpst) 2008-08-05 17:29:53 PDT
Created attachment 22668 [details]
Proposed patch
Comment 3 Darin Adler 2008-08-05 17:31:22 PDT
Comment on attachment 22668 [details]
Proposed patch

Comment 4 Cameron Zwarich (cpst) 2008-08-05 17:42:08 PDT
Landed in r35584.