diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-03-21 19:38:08 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-03-24 13:02:06 +0100 |
commit | 07def30fa7d5c5aa73e9d522a2e17bfa7a272df8 (patch) | |
tree | 0462566fa8112c51116a059fd26e2f5bdaa55143 | |
parent | 6faa126fc3ba24a782e832cb0000d6d4f6b7b576 (diff) | |
download | libxml2-07def30fa7d5c5aa73e9d522a2e17bfa7a272df8.tar.gz |
Restore context size and position after XPATH_OP_ARG
Fixes a bug with predicates:
https://mail.gnome.org/archives/xml/2014-March/msg00014.html
-rw-r--r-- | xpath.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -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); |