Skip to content

Commit

Permalink
[BZ 697]
Browse files Browse the repository at this point in the history
	* posix/regexec.c (prune_impossible_nodes): Handle sifted_states[0]
	being NULL also if there are no backreferences.
	* posix/rxspencer/tests: Add testcases.
  • Loading branch information
Ulrich Drepper committed Jan 8, 2009
1 parent bdb56ba commit 76c7f2c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2009-01-05 Paolo Bonzini <bonzini@gnu.org>

[BZ 697]
* posix/regexec.c (prune_impossible_nodes): Handle sifted_states[0]
being NULL also if there are no backreferences.
* posix/rxspencer/tests: Add testcases.

2009-01-04 Paolo Bonzini <bonzini@gnu.org>

[BZ 9697]
Expand Down
7 changes: 6 additions & 1 deletion posix/regexec.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
Copyright (C) 2002, 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
Expand Down Expand Up @@ -1004,6 +1004,11 @@ prune_impossible_nodes (mctx)
re_node_set_free (&sctx.limits);
if (BE (ret != REG_NOERROR, 0))
goto free_return;
if (sifted_states[0] == NULL)
{
ret = REG_NOMATCH;
goto free_return;
}
}
re_free (mctx->state_log);
mctx->state_log = sifted_states;
Expand Down
4 changes: 4 additions & 0 deletions posix/rxspencer/tests
Original file line number Diff line number Diff line change
Expand Up @@ -536,3 +536,7 @@ a.*\b & abT ab
\B & aSbTc
\B & SaT @SaT
\B & aSTSb @TSb

o$($|.) - oN
o$($|.) - op
o$($|.) - o o

0 comments on commit 76c7f2c

Please sign in to comment.