Changeset 40396 in webkit for trunk/JavaScriptCore/interpreter


Ignore:
Timestamp:
Jan 29, 2009, 7:09:35 PM (16 years ago)
Author:
[email protected]
Message:

2009-01-29 Cameron Zwarich <[email protected]>

Reviewed by Oliver Hunt.

Bug 23551: Crash on page load with profiler enabled and running
<https://bugs.webkit.org/show_bug.cgi?id=23551>
<rdar://problem/6529521>

Interpreter::execute(FunctionBodyNode*, ...) calls Profiler::didExecute()
with a stale CallFrame. If some part of the scope chain has already been
freed, Profiler::didExecute() will crash when attempting to get the lexical
global object. The fix is to make the didExecute() call use the caller's
CallFrame, not the one made for the function call. In this case, the
willExecute() call should also be changed to match.

Since this occurs in the actual inspector JS, it is difficult to reduce.
I couldn't make a layout test.

  • interpreter/Interpreter.cpp: (JSC::Interpreter::execute):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/interpreter/Interpreter.cpp

    r40111 r40396  
    922922    Profiler** profiler = Profiler::enabledProfilerReference();
    923923    if (*profiler)
    924         (*profiler)->willExecute(newCallFrame, function);
     924        (*profiler)->willExecute(callFrame, function);
    925925
    926926    JSValuePtr result;
     
    940940
    941941    if (*profiler)
    942         (*profiler)->didExecute(newCallFrame, function);
     942        (*profiler)->didExecute(callFrame, function);
    943943
    944944    m_registerFile.shrink(oldEnd);
Note: See TracChangeset for help on using the changeset viewer.