regex: fix test for deciding whether to use smatcher or lmatcher
commit9afcab2ae805b93f04cb4ec303ea6a554afb1971
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 19 Jun 2013 20:52:46 +0000 (19 22:52 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 19 Jun 2013 21:12:33 +0000 (19 23:12 +0200)
tree9089467e6401af6abc53839e49fa2a47d7e9ef5f
parent917d600f66e27aa788b121805eff227cafe83e18
regex: fix test for deciding whether to use smatcher or lmatcher

smatcher can only be used if the number of states does not exceed
the number of bits of type for "states" in smatcher, which is "int".
However, the code that tests this condition is formulated in terms
of "states1", which is defined to be "states", which in turn is
redefined to "char *" before the test.
If the size of a "char *" is larger than that of an "int", the test
would therefore produce the wrong result.
Define "states1" to "int" so that it does not get redefined to "char *".

The code was introduced in 29c4dc3 (Wed May 3 10:50:31 2000 +0000).
Unfortunately, the commit message does not explain where the code
was copied from, so it is not clear if this problem has already
been fixed upstream.

Reported-by: Donald Allen <donaldcallen@gmail.com>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
regex/regexec.c