Bug 23016 - JavaScriptDebugServer::recompileAllJSFunctions() should not execute JS while reparsing all functions
Summary: JavaScriptDebugServer::recompileAllJSFunctions() should not execute JS while ...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Cameron Zwarich (cpst)
Keywords: InRadar
Depends on:
Reported: 2008-12-28 15:50 PST by Cameron Zwarich (cpst)
Modified: 2008-12-28 17:35 PST (History)
1 user (show)

See Also:

Proposed patch (3.10 KB, patch)
2008-12-28 16:02 PST, Cameron Zwarich (cpst)
sam: 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-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.