summaryrefslogtreecommitdiff
path: root/regcomp.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-12-29 13:29:37 +0000
committerNicholas Clark <nick@ccl4.org>2007-12-29 13:29:37 +0000
commitc8e4cf8b7082ad71ba42564a3d098566ed2a16ac (patch)
treec9a5302036e9a36073691efabfbdf3fbd114c627 /regcomp.pl
parent10300be4785857111b4e5614934a2d871b62b6ce (diff)
downloadperl-c8e4cf8b7082ad71ba42564a3d098566ed2a16ac.tar.gz
die if multiple macros in regexp.h attempt to use the same flag bit.
p4raw-id: //depot/perl@32762
Diffstat (limited to 'regcomp.pl')
-rw-r--r--regcomp.pl12
1 files changed, 9 insertions, 3 deletions
diff --git a/regcomp.pl b/regcomp.pl
index 17472cc811..defbb5f785 100644
--- a/regcomp.pl
+++ b/regcomp.pl
@@ -197,11 +197,17 @@ EOP
open my $fh,"<","regexp.h" or die "Can't read regexp.h: $!";
my %rxfv;
-my $val;
+my $val = 0;
+my %reverse;
while (<$fh>) {
if (/#define\s+(RXf_\w+)\s+(0x[A-F\d]+)/i) {
- $rxfv{$1}= eval $2;
- $val|=$rxfv{$1};
+ my $newval = eval $2;
+ if($val & $newval) {
+ die sprintf "Both $1 and $reverse{$newval} use %08X", $newval;
+ }
+ $val|=$newval;
+ $rxfv{$1}= $newval;
+ $reverse{$newval} = $1;
}
}
my %vrxf=reverse %rxfv;