⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 233540 in webkit


Ignore:
Timestamp:
Jul 5, 2018, 2:35:09 PM (8 years ago)
Author:
sbarati@apple.com
Message:

ProgramExecutable may be collected as we checkSyntax on it
​https://bugs.webkit.org/show_bug.cgi?id=187359
<rdar://problem/41832135>

Reviewed by Mark Lam.

The bug was we were passing in a reference to the SourceCode field on ProgramExecutable as
the ProgramExecutable itself may be collected. The fix here is to make a copy
of the field instead of passing in a reference inside of ParserError::toErrorObject.

No new tests here as this was already caught by our iOS JSC testers.

  • parser/ParserError.h:

(JSC::ParserError::toErrorObject):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r233501 r233540  
     12018-07-05  Saam Barati  <sbarati@apple.com>
     2
     3        ProgramExecutable may be collected as we checkSyntax on it
     4        https://bugs.webkit.org/show_bug.cgi?id=187359
     5        <rdar://problem/41832135>
     6
     7        Reviewed by Mark Lam.
     8
     9        The bug was we were passing in a reference to the SourceCode field on ProgramExecutable as
     10        the ProgramExecutable itself may be collected. The fix here is to make a copy
     11        of the field instead of passing in a reference inside of ParserError::toErrorObject.
     12       
     13        No new tests here as this was already caught by our iOS JSC testers.
     14
     15        * parser/ParserError.h:
     16        (JSC::ParserError::toErrorObject):
     17
    1182018-07-04  Tim Horton  <timothy_horton@apple.com>
    219
  • trunk/Source/JavaScriptCore/parser/ParserError.h

    r233377 r233540  
    8787
    8888    JSObject* toErrorObject(
    89         JSGlobalObject* globalObject, const SourceCode& source,
     89        JSGlobalObject* globalObject,
     90        SourceCode source, // Note: We must copy the source here, since the objects that pass in their SourceCode field may be destroyed in addErrorInfo.
    9091        int overrideLineNumber = -1)
    9192    {
Note: See TracChangeset for help on using the changeset viewer.