[libxml2] Fix an XSD error when generating internal automata



commit c70d185a2a3d09b0762560d4f93205da5d43396c
Author: Daniel Veillard <veillard redhat com>
Date:   Thu Aug 23 23:28:04 2012 +0800

    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>

 xmlschemas.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/xmlschemas.c b/xmlschemas.c
index d44ec89..c3a080f 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]