summaryrefslogtreecommitdiff
path: root/relaxng.c
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2005-02-05 12:06:19 +0000
committerMike Hommey <mh@glandium.org>2005-02-05 12:06:19 +0000
commita7457388701e6ccba9091ba3ec09505dc903b758 (patch)
tree80a7d0fba3968fee73cc71a62ffe1af039396f29 /relaxng.c
parentf51dd67f3a3f472af0620391eb588eeca4533689 (diff)
downloadlibxml2-a7457388701e6ccba9091ba3ec09505dc903b758.tar.gz
Load /tmp/tmp.5kkLmZ/libxml2-2.6.17 intoupstream/2.6.17
packages/libxml2/branches/upstream/current.
Diffstat (limited to 'relaxng.c')
-rw-r--r--relaxng.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/relaxng.c b/relaxng.c
index af4de86..16174e0 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -10047,8 +10047,13 @@ xmlRelaxNGValidateState(xmlRelaxNGValidCtxtPtr ctxt,
node = xmlRelaxNGSkipIgnored(ctxt, node);
errNr = ctxt->errNr;
- if ((define->dflags & IS_TRIABLE)
- && (define->data != NULL)) {
+ if ((define->dflags & IS_TRIABLE) && (define->data != NULL) &&
+ (node != NULL)) {
+ /*
+ * node == NULL can't be optimized since IS_TRIABLE
+ * doesn't account for choice which may lead to
+ * only attributes.
+ */
xmlHashTablePtr triage =
(xmlHashTablePtr) define->data;
@@ -10056,10 +10061,6 @@ xmlRelaxNGValidateState(xmlRelaxNGValidCtxtPtr ctxt,
* Something we can optimize cleanly there is only one
* possble branch out !
*/
- if (node == NULL) {
- ret = -1;
- break;
- }
if ((node->type == XML_TEXT_NODE) ||
(node->type == XML_CDATA_SECTION_NODE)) {
list =