1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-23 01:52:48 +03:00

Fix an XSD error when generating internal automata

When generating a sequence add an extra epsilon transition
to avoid further constructs from entering via the last state
Bug reported by Johan Corveleyn <jcorvel@gmail.com>
This commit is contained in:
Daniel Veillard
2012-08-23 23:28:04 +08:00
parent 82cdfc4eb3
commit c70d185a2a

View File

@@ -12957,6 +12957,15 @@ xmlSchemaBuildAContentModel(xmlSchemaParserCtxtPtr pctxt,
if (tmp2 != 1) ret = 0;
sub = sub->next;
}
/*
* epsilon needed to block previous trans from
* being allowed to enter back from another
* construct
*/
pctxt->state = xmlAutomataNewEpsilon(pctxt->am,
pctxt->state, NULL);
if (particle->minOccurs == 0) {
xmlAutomataNewEpsilon(pctxt->am, oldstate,
pctxt->state);