mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-12-28 07:21:26 +03:00
Fix XPath '//' optimization with predicates
My attempt to optimize XPath expressions containing '//' caused a regression reported in bug #695699. This commit disables the optimization for expressions of the form '//foo[predicate]'.
This commit is contained in:
parent
ff76eb28c7
commit
b4bcba23f6
5
xpath.c
5
xpath.c
@ -14724,8 +14724,9 @@ xmlXPathOptimizeExpression(xmlXPathCompExprPtr comp, xmlXPathStepOpPtr op)
|
|||||||
* internal representation.
|
* internal representation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((op->ch1 != -1) &&
|
if ((op->op == XPATH_OP_COLLECT /* 11 */) &&
|
||||||
(op->op == XPATH_OP_COLLECT /* 11 */))
|
(op->ch1 != -1) &&
|
||||||
|
(op->ch2 == -1 /* no predicate */))
|
||||||
{
|
{
|
||||||
xmlXPathStepOpPtr prevop = &comp->steps[op->ch1];
|
xmlXPathStepOpPtr prevop = &comp->steps[op->ch1];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user