Changeset 74586 in webkit


Ignore:
Timestamp:
Dec 23, 2010 3:10:45 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-12-23 Yongjun Zhang <yongjun_zhang@apple.com>

Reviewed by Darin Adler.

WebKit crashes at DebuggerCallFrame::functionName() if m_callFrame is the top global callframe.
https://bugs.webkit.org/show_bug.cgi?id=38535

WebScriptDebugger in WebKit has empty implementations for willExecuteProgram and didExecuteProgram. As a result,
if the top call frame is from a program, WebKitScriptDebugger doesn't record that callframe as the top frame, and
WebScriptDebugger's callframe stack is wrong from this point. That could cause crash if we trying to access the top
call frame from this stack when an exception throws because the saved top frame could be invalid.

To fix that, we need to maintain the call frame stack in willExecuteProgram and didExecuteProgram, as we did in
callEvent and returnEvent.

  • WebView/WebScriptDebugger.mm: (WebScriptDebugger::willExecuteProgram): (WebScriptDebugger::didExecuteProgram):
Location:
trunk/WebKit/mac
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/mac/ChangeLog

    r74571 r74586  
     12010-12-23  Yongjun Zhang  <yongjun_zhang@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        WebKit crashes at DebuggerCallFrame::functionName() if m_callFrame is the top global callframe.
     6        https://bugs.webkit.org/show_bug.cgi?id=38535
     7
     8        WebScriptDebugger in WebKit has empty implementations for willExecuteProgram and didExecuteProgram.  As a result,
     9        if the top call frame is from a program, WebKitScriptDebugger doesn't record that callframe as the top frame, and
     10        WebScriptDebugger's callframe stack is wrong from this point.  That could cause crash if we trying to access the top
     11        call frame from this stack when an exception throws because the saved top frame could be invalid.
     12
     13        To fix that, we need to maintain the call frame stack in willExecuteProgram and didExecuteProgram, as we did in
     14        callEvent and returnEvent.
     15
     16        * WebView/WebScriptDebugger.mm:
     17        (WebScriptDebugger::willExecuteProgram):
     18        (WebScriptDebugger::didExecuteProgram):
     19
    1202010-12-22  Sam Weinig  <sam@webkit.org>
    221
  • trunk/WebKit/mac/WebView/WebScriptDebugger.mm

    r65177 r74586  
    221221void WebScriptDebugger::willExecuteProgram(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineno)
    222222{
     223    callEvent(debuggerCallFrame, sourceID, lineno);
    223224}
    224225
    225226void WebScriptDebugger::didExecuteProgram(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineno)
    226227{
     228    returnEvent(debuggerCallFrame, sourceID, lineno);
    227229}
    228230
Note: See TracChangeset for help on using the changeset viewer.