[libxml2] Restore context size and position after XPATH_OP_ARG
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Restore context size and position after XPATH_OP_ARG
- Date: Tue, 25 Mar 2014 17:45:24 +0000 (UTC)
commit 07def30fa7d5c5aa73e9d522a2e17bfa7a272df8
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Fri Mar 21 19:38:08 2014 +0100
Restore context size and position after XPATH_OP_ARG
Fixes a bug with predicates:
https://mail.gnome.org/archives/xml/2014-March/msg00014.html
xpath.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/xpath.c b/xpath.c
index 89eaba8..dc41ce6 100644
--- a/xpath.c
+++ b/xpath.c
@@ -13594,17 +13594,20 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
bak = ctxt->context->node;
pp = ctxt->context->proximityPosition;
cs = ctxt->context->contextSize;
- if (op->ch1 != -1)
+ if (op->ch1 != -1) {
total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
- ctxt->context->contextSize = cs;
- ctxt->context->proximityPosition = pp;
- ctxt->context->node = bak;
- ctxt->context->doc = bakd;
- CHECK_ERROR0;
+ ctxt->context->contextSize = cs;
+ ctxt->context->proximityPosition = pp;
+ ctxt->context->node = bak;
+ ctxt->context->doc = bakd;
+ CHECK_ERROR0;
+ }
if (op->ch2 != -1) {
total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
- ctxt->context->doc = bakd;
- ctxt->context->node = bak;
+ ctxt->context->contextSize = cs;
+ ctxt->context->proximityPosition = pp;
+ ctxt->context->node = bak;
+ ctxt->context->doc = bakd;
CHECK_ERROR0;
}
return (total);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]