aboutsummaryrefslogtreecommitdiff
path: root/xsd
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-10-17 16:06:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-10-17 16:06:53 +0200
commitd616ee160385bfb4f2edc11203b645642f3783ef (patch)
tree6a42a867589a6d4bb1e7d12727bf1e787931b9d2 /xsd
parent894edfaebb69d3d19b5e60124166b8f32822d447 (diff)
Fix bug in cardinality calculation
Diffstat (limited to 'xsd')
-rw-r--r--xsd/processing/cardinality/processor.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/xsd/processing/cardinality/processor.cxx b/xsd/processing/cardinality/processor.cxx
index 8356ee8..0fcabed 100644
--- a/xsd/processing/cardinality/processor.cxx
+++ b/xsd/processing/cardinality/processor.cxx
@@ -144,7 +144,13 @@ namespace Processing
else
{
ei.min = j->second.min < ei.min ? j->second.min : ei.min;
- ei.max = j->second.max > ei.max ? j->second.max : ei.max;
+
+ // Unbounded is encoded as 0.
+ //
+ if (j->second.max == 0 || ei.max == 0)
+ ei.max = 0;
+ else
+ ei.max = j->second.max > ei.max ? j->second.max : ei.max;
}
}