1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

fixed bug #310264, basically it's about reentrancy of count based

* xmlregexp.c: fixed bug #310264, basically it's about reentrancy
  of count based transition, when going though the counter must
  be reset to 0
* test/schemas/bug310264* result/schemas/bug310264*: added the
  regression test.
Daniel
This commit is contained in:
Daniel Veillard
2005-08-08 13:05:13 +00:00
parent 004b5463eb
commit 10752284e3
6 changed files with 85 additions and 1 deletions

View File

@ -38,7 +38,7 @@
#endif
/* #define DEBUG_REGEXP_GRAPH */
/* #define DEBUG_REGEXP_EXEC */
/* #define DEBUG_REGEXP_EXEC */
/* #define DEBUG_PUSH */
/* #define DEBUG_COMPACTION */
@ -2579,6 +2579,14 @@ xmlFARegExec(xmlRegexpPtr comp, const xmlChar *content) {
#endif
exec->counts[trans->counter]++;
}
if ((trans->count >= 0) &&
(trans->count < REGEXP_ALL_COUNTER)) {
#ifdef DEBUG_REGEXP_EXEC
printf("resetting count %d on transition\n",
trans->count);
#endif
exec->counts[trans->count] = 0;
}
#ifdef DEBUG_REGEXP_EXEC
printf("entering state %d\n", trans->to);
#endif
@ -3146,6 +3154,14 @@ xmlRegExecPushString(xmlRegExecCtxtPtr exec, const xmlChar *value,
#endif
exec->counts[trans->counter]++;
}
if ((trans->count >= 0) &&
(trans->count < REGEXP_ALL_COUNTER)) {
#ifdef DEBUG_REGEXP_EXEC
printf("resetting count %d on transition\n",
trans->count);
#endif
exec->counts[trans->count] = 0;
}
#ifdef DEBUG_PUSH
printf("entering state %d\n", trans->to);
#endif