[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gawk pb (IGNORECASE)
From: |
Christophe Bisière |
Subject: |
gawk pb (IGNORECASE) |
Date: |
Tue, 22 Jul 2003 15:30:42 +0200 |
User-agent: |
KMail/1.5.2 |
Hi List,
With:
Linux tiwa.vgam 2.4.20-gentoo-r5 #2 sam mai 17 16:05:53 CEST 2003 i686 Pentium
III (Coppermine) GenuineIntel GNU/Linux
gcc (GCC) 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice)
GNU Awk 3.1.2
running
echo "a" | ./gawk -v IGNORECASE=1 "/[[:alnum:]]/{}"
gives
gawk: cmd. line:1: (FILENAME=- FNR=1) fatal error: internal error
Notes:
- input does not matter
- the key point is the reference to the regexp while IGNORECASE=1
(the problem still appears when the regexp is in a sub, gsub, gensub, etc)
I tracked down the problem to the macro BUILD_CHARCLASS_LOOP in
regcomp.c:3249.
For i > 127, trans[i] contains negative numbers. The call to bitset_set (line
3255 in regcomp.c) thus segfaults.
As a workaround, changing (line 3254)
int ch = trans ? trans[i] : i;
to
unsigned char ch = trans ? trans[i] : i;
solves the problem (at least for me).
Cheers, and many thanks for your work,
Christophe
--
Christophe Bisière
University of Toulouse, France
- gawk pb (IGNORECASE),
Christophe Bisière <=