Bug 23016

Summary: JavaScriptDebugServer::recompileAllJSFunctions() should not execute JS while reparsing all functions
Product: WebKit Reporter: Cameron Zwarich (cpst) <zwarich>
Component: Web Inspector (Deprecated)Assignee: Cameron Zwarich (cpst) <zwarich>
Severity: Normal CC: ddkilzer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Description Flags
Proposed patch sam: review+

Description Cameron Zwarich (cpst) 2008-12-28 15:50:21 PST
JavaScriptDebugServer::recompileAllJSFunctions() calls sourceParsed() while reparsing all JS functions, which will execute JS in the inspector. Depending on the order in which functions are recompiled, a function could have a new body but other functions that have not been recompiled could have an optimized (in the sense of inline caching) call to it, bypassing the check of whether or not there is generated bytecode. This leads to a crash caused by accessing indices off of a null pointer.

The fix is to just make the calls to sourceParsed() after reparsing all functions. As a side note, it seems like a poor idea to add debug hooks to all inspector JS. This is probably a significant performance hit for the inspector.
Comment 1 Cameron Zwarich (cpst) 2008-12-28 15:50:49 PST
Comment 2 Cameron Zwarich (cpst) 2008-12-28 16:02:28 PST
Created attachment 26284 [details]
Proposed patch
Comment 3 Cameron Zwarich (cpst) 2008-12-28 17:35:39 PST
Landed in r39497.