diff options
author | Peter Hartmann <peter.hartmann@nokia.com> | 2010-03-16 13:01:17 (GMT) |
---|---|---|
committer | Peter Hartmann <peter.hartmann@nokia.com> | 2010-04-26 17:26:45 (GMT) |
commit | 5b086892cec1cbcd9fe7f0abca5293519ecc4633 (patch) | |
tree | e7b395eb4160b0eefd49041a34b1fdd79f83ad4c /src/xmlpatterns | |
parent | c3067851071ae9480688e0d746dd6b03bd113823 (diff) | |
download | Qt-5b086892cec1cbcd9fe7f0abca5293519ecc4633.zip Qt-5b086892cec1cbcd9fe7f0abca5293519ecc4633.tar.gz Qt-5b086892cec1cbcd9fe7f0abca5293519ecc4633.tar.bz2 |
QXmlSchema internals: fix crash with anonymous types
The crash occurred when an anonymous type was created that was a list
type. In that case, we did not set the item type, which is used later at
XsdSchemaChecker::checkSimpleDerivationRestrictions(), which would lead
to a crash.
Additionally, in the xmlpatternsvalidator test, check the exit status of
the process after it has finished, to detect crashes.
Reviewed-by: Tobias Koenig <tokoe@kde.org>
Reviewed-by: Frans Englich
Task-number: QTBUG-8920
Diffstat (limited to 'src/xmlpatterns')
-rw-r--r-- | src/xmlpatterns/schema/qxsdschemaresolver.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/xmlpatterns/schema/qxsdschemaresolver.cpp b/src/xmlpatterns/schema/qxsdschemaresolver.cpp index 34eb12c..f3d1ed0 100644 --- a/src/xmlpatterns/schema/qxsdschemaresolver.cpp +++ b/src/xmlpatterns/schema/qxsdschemaresolver.cpp @@ -632,7 +632,14 @@ void XsdSchemaResolver::resolveSimpleContentComplexTypes(const XsdComplexType::P } else { // 1.2 const XsdSimpleType::Ptr anonType(new XsdSimpleType()); - anonType->setCategory(complexBaseType->contentType()->simpleType()->category()); + XsdSimpleType::TypeCategory baseCategory = complexBaseType->contentType()->simpleType()->category(); + anonType->setCategory(baseCategory); + + if (baseCategory == XsdSimpleType::SimpleTypeList) { + const XsdSimpleType::Ptr baseSimpleType = complexBaseType->contentType()->simpleType(); + anonType->setItemType(baseSimpleType->itemType()); + } + anonType->setDerivationMethod(XsdSimpleType::DerivationRestriction); anonType->setWxsSuperType(complexBaseType->contentType()->simpleType()); anonType->setFacets(complexTypeFacets(complexType)); |