Ignore:
Timestamp:
Nov 8, 2011, 12:37:52 PM (14 years ago)
Author:
[email protected]
Message:

JSC::Parser::Parser leaks Lexer member
https://bugs.webkit.org/show_bug.cgi?id=71847

Changed m_lexer member of Parser to be OwnPtr to fix a memory leak.

Reviewed by Oliver Hunt.

  • parser/Parser.cpp:

(JSC::Parser::Parser):
(JSC::Parser::parseFunctionBody):

  • parser/Parser.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/Parser.cpp

    r99513 r99608  
    5858    , m_sourceElements(0)
    5959{
    60     m_lexer = new Lexer<UChar>(globalData);
     60    m_lexer = adoptPtr(new Lexer<UChar>(globalData));
    6161    m_arena = m_globalData->parserArena;
    6262    m_lexer->setCode(source, m_arena);
     
    741741    DepthManager statementDepth(&m_statementDepth);
    742742    m_statementDepth = 0;
    743     typename TreeBuilder::FunctionBodyBuilder bodyBuilder(const_cast<JSGlobalData*>(m_globalData), m_lexer);
     743    typename TreeBuilder::FunctionBodyBuilder bodyBuilder(const_cast<JSGlobalData*>(m_globalData), m_lexer.get());
    744744    failIfFalse(parseSourceElements<CheckForStrictMode>(bodyBuilder));
    745745    return context.createFunctionBody(m_lexer->lastLineNumber(), strictMode());
Note: See TracChangeset for help on using the changeset viewer.