Ignore:
Timestamp:
Feb 15, 2010, 12:32:15 PM (15 years ago)
Author:
[email protected]
Message:

Fixed <rdar://problem/7628524> Crash beneath JSGlobalContextRelease when
typing in Google search field with GuardMalloc/full page heap enabled

Reviewed by Oliver Hunt.

  • API/JSContextRef.cpp: Don't use APIEntryShim, since that requires

a JSGlobalData, which this function destroys. Do use setCurrentIdentifierTable
and JSLock instead, since those are the two features of APIEntryShim we
require.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSContextRef.cpp

    r53460 r54785  
    121121{
    122122    ExecState* exec = toJS(ctx);
    123     APIEntryShim entryShim(exec, false);
     123    JSLock lock(exec);
     124
     125    JSGlobalData& globalData = exec->globalData();
     126    IdentifierTable* savedIdentifierTable = setCurrentIdentifierTable(globalData.identifierTable);
    124127
    125128    gcUnprotect(exec->dynamicGlobalObject());
    126129
    127     JSGlobalData& globalData = exec->globalData();
    128130    if (globalData.refCount() == 2) { // One reference is held by JSGlobalObject, another added by JSGlobalContextRetain().
    129131        // The last reference was released, this is our last chance to collect.
     
    133135
    134136    globalData.deref();
     137
     138    setCurrentIdentifierTable(savedIdentifierTable);
    135139}
    136140
Note: See TracChangeset for help on using the changeset viewer.