mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
fixing bug #132930 with the provided patch, a bit suspicious about it but
* xmlregexp.c: fixing bug #132930 with the provided patch, a bit suspicious about it but this is fairly contained and regression tests still passes. * test/schemas/all1* result/schemas/all1*: added the test to the regression suite. Daniel
This commit is contained in:
19
xmlregexp.c
19
xmlregexp.c
@ -4325,6 +4325,7 @@ xmlAutomataNewCountTrans(xmlAutomataPtr am, xmlAutomataStatePtr from,
|
||||
xmlAutomataStatePtr to, const xmlChar *token,
|
||||
int min, int max, void *data) {
|
||||
xmlRegAtomPtr atom;
|
||||
int counter;
|
||||
|
||||
if ((am == NULL) || (from == NULL) || (token == NULL))
|
||||
return(NULL);
|
||||
@ -4343,10 +4344,22 @@ xmlAutomataNewCountTrans(xmlAutomataPtr am, xmlAutomataStatePtr from,
|
||||
atom->min = min;
|
||||
atom->max = max;
|
||||
|
||||
if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
|
||||
xmlRegFreeAtom(atom);
|
||||
return(NULL);
|
||||
/*
|
||||
* associate a counter to the transition.
|
||||
*/
|
||||
counter = xmlRegGetCounter(am);
|
||||
am->counters[counter].min = min;
|
||||
am->counters[counter].max = max;
|
||||
|
||||
/* xmlFAGenerateTransitions(am, from, to, atom); */
|
||||
if (to == NULL) {
|
||||
to = xmlRegNewState(am);
|
||||
xmlRegStatePush(am, to);
|
||||
}
|
||||
xmlRegStateAddTrans(am, from, atom, to, counter, -1);
|
||||
xmlRegAtomPush(am, atom);
|
||||
am->state = to;
|
||||
|
||||
if (to == NULL)
|
||||
to = am->state;
|
||||
if (to == NULL)
|
||||
|
Reference in New Issue
Block a user