summaryrefslogtreecommitdiff
path: root/xpath.c
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2007-08-26 10:38:52 +0200
committerMike Hommey <glandium@debian.org>2007-08-26 10:38:52 +0200
commitc69572cb9f2467259a73de64c08e141f21f17fa8 (patch)
treeb0ac225bcbeea038aaa7db22f0ebb7786d07a391 /xpath.c
parent58f9d16e3a77d5207d9ccc413b61e2cb45190018 (diff)
downloadlibxml2-c69572cb9f2467259a73de64c08e141f21f17fa8.tar.gz
Load /tmp/libxml2-2.6.30 intoupstream/2.6.30.dfsg
libxml2/branches/upstream/current.
Diffstat (limited to 'xpath.c')
-rw-r--r--xpath.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/xpath.c b/xpath.c
index 8f6545a..22a3f9d 100644
--- a/xpath.c
+++ b/xpath.c
@@ -3057,7 +3057,8 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
precedence1 = 2; /* element is parent */
node1 = node1->parent;
}
- if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE)) {
+ if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE) ||
+ (0 <= (long) node1->content)) {
/*
* Fallback for whatever case.
*/
@@ -3194,11 +3195,6 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
turtle_comparison:
- if (miscNode1 != NULL)
- node1 = miscNode1;
- if (miscNode2 != NULL)
- node2 = miscNode2;
-
if (node1 == node2->prev)
return(1);
if (node1 == node2->next)
@@ -11710,8 +11706,15 @@ xmlXPathCompOpEvalPositionalPredicate(xmlXPathParserContextPtr ctxt,
valuePush(ctxt, contextObj);
res = xmlXPathCompOpEvalToBoolean(ctxt, exprOp, 1);
- if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1))
+ if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) {
+ xmlXPathObjectPtr tmp;
+ /* pop the result */
+ tmp = valuePop(ctxt);
+ xmlXPathReleaseObject(xpctxt, tmp);
+ /* then pop off contextObj, which will be freed later */
+ valuePop(ctxt);
goto evaluation_error;
+ }
if (res)
pos++;