mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
fix bug #319897, problem with counted atoms when the transition itself is
* xmlregexp.c: fix bug #319897, problem with counted atoms when the transition itself is counted too * result/regexp/hard test/regexp/hard: augmented the regression tests with the problem exposed. Daniel
This commit is contained in:
14
xmlregexp.c
14
xmlregexp.c
@ -2812,7 +2812,15 @@ xmlFARegExec(xmlRegexpPtr comp, const xmlChar *content) {
|
||||
|
||||
/*
|
||||
* this is a multiple input sequence
|
||||
* If there is a counter associated increment it now.
|
||||
* before potentially saving and rollback
|
||||
*/
|
||||
if (trans->counter >= 0) {
|
||||
#ifdef DEBUG_REGEXP_EXEC
|
||||
printf("Increasing count %d\n", trans->counter);
|
||||
#endif
|
||||
exec->counts[trans->counter]++;
|
||||
}
|
||||
if (exec->state->nbTrans > exec->transno + 1) {
|
||||
xmlFARegExecSave(exec);
|
||||
}
|
||||
@ -2862,6 +2870,12 @@ xmlFARegExec(xmlRegexpPtr comp, const xmlChar *content) {
|
||||
if (ret == 0) {
|
||||
goto rollback;
|
||||
}
|
||||
if (trans->counter >= 0) {
|
||||
#ifdef DEBUG_REGEXP_EXEC
|
||||
printf("Decreasing count %d\n", trans->counter);
|
||||
#endif
|
||||
exec->counts[trans->counter]--;
|
||||
}
|
||||
} else if ((ret == 0) && (atom->min == 0) && (atom->max > 0)) {
|
||||
/*
|
||||
* we don't match on the codepoint, but minOccurs of 0
|
||||
|
Reference in New Issue
Block a user