Changeset 157287 in webkit


Ignore:
Timestamp:
Oct 10, 2013 8:51:44 PM (11 years ago)
Author:
Darin Adler
Message:

REGRESSION (r157205?): Leaks in XPath
https://bugs.webkit.org/show_bug.cgi?id=122609

Reviewed by Andreas Kling.

  • xml/XPathGrammar.y: Fixed warnings by adding missing "$$ = $1" to various rules.

Added local unique_ptr for NodeTest and ArgumentList in three rules, so they
won't be leaked.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r157286 r157287  
     12013-10-10  Darin Adler  <darin@apple.com>
     2
     3        REGRESSION (r157205?): Leaks in XPath
     4        https://bugs.webkit.org/show_bug.cgi?id=122609
     5
     6        Reviewed by Andreas Kling.
     7
     8        * xml/XPathGrammar.y: Fixed warnings by adding missing "$$ = $1" to various rules.
     9        Added local unique_ptr for NodeTest and ArgumentList in three rules, so they
     10        won't be leaked.
     11
    1122013-10-10  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    213
  • trunk/Source/WebCore/xml/XPathGrammar.y

    r157224 r157287  
    115115    AbsoluteLocationPath
    116116    {
     117        $$ = $1;
    117118        $$->setAbsolute();
    118119    }
     
    148149    RelativeLocationPath '/' Step
    149150    {
     151        $$ = $1;
    150152        $$->appendStep(std::unique_ptr<Step>($3));
    151153    }
     
    153155    RelativeLocationPath DescendantOrSelf Step
    154156    {
     157        $$ = $1;
    155158        $$->appendStep(std::unique_ptr<Step>($2));
    156159        $$->appendStep(std::unique_ptr<Step>($3));
     
    161164    NodeTest OptionalPredicateList
    162165    {
     166        std::unique_ptr<Step::NodeTest> nodeTest($1);
    163167        std::unique_ptr<Vector<std::unique_ptr<Expression>>> predicateList($2);
    164168        if (predicateList)
    165             $$ = new Step(Step::ChildAxis, std::move(*$1), std::move(*predicateList));
     169            $$ = new Step(Step::ChildAxis, std::move(*nodeTest), std::move(*predicateList));
    166170        else
    167             $$ = new Step(Step::ChildAxis, std::move(*$1));
     171            $$ = new Step(Step::ChildAxis, std::move(*nodeTest));
    168172    }
    169173    |
     
    188192    AxisSpecifier NodeTest OptionalPredicateList
    189193    {
     194        std::unique_ptr<Step::NodeTest> nodeTest($2);
    190195        std::unique_ptr<Vector<std::unique_ptr<Expression>>> predicateList($3);
    191196
    192197        if (predicateList)
    193             $$ = new Step($1, std::move(*$2), std::move(*predicateList));
     198            $$ = new Step($1, std::move(*nodeTest), std::move(*predicateList));
    194199        else
    195             $$ = new Step($1, std::move(*$2));
     200            $$ = new Step($1, std::move(*nodeTest));
    196201    }
    197202    |
     
    342347    {
    343348        String name = adoptRef($1);
    344         $$ = XPath::Function::create(name, std::move(*$3)).release();
     349        std::unique_ptr<Vector<std::unique_ptr<Expression>>> argumentList($3);
     350        $$ = XPath::Function::create(name, std::move(*argumentList)).release();
    345351        if (!$$)
    346352            YYABORT;
     
    377383PathExpr:
    378384    LocationPath
     385    {
     386        $$ = $1;
     387    }
    379388    |
    380389    FilterExpr
Note: See TracChangeset for help on using the changeset viewer.