1
From: Nick Wellnhofer <wellnhofer@aevum.de>
2
Date: Sun, 4 Aug 2013 22:15:11 +0000
3
Subject: Fix XPath '//' optimization with predicates
5
My attempt to optimize XPath expressions containing '//' caused a
6
regression reported in bug #695699. This commit disables the
7
optimization for expressions of the form '//foo[predicate]'.
10
1 file changed, 3 insertions(+), 2 deletions(-)
12
diff --git a/xpath.c b/xpath.c
13
index 97410e7..a676989 100644
16
@@ -14719,8 +14719,9 @@ xmlXPathOptimizeExpression(xmlXPathCompExprPtr comp, xmlXPathStepOpPtr op)
17
* internal representation.
20
- if ((op->ch1 != -1) &&
21
- (op->op == XPATH_OP_COLLECT /* 11 */))
22
+ if ((op->op == XPATH_OP_COLLECT /* 11 */) &&
24
+ (op->ch2 == -1 /* no predicate */))
26
xmlXPathStepOpPtr prevop = &comp->steps[op->ch1];