From: Rudolf Polzer Date: Sat, 31 Aug 2013 18:36:08 +0000 (+0200) Subject: Fix for stupid bug. X-Git-Tag: xonotic-v0.8.0~83 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2f45c3608eba388ad00d4e800d584d3c08f25f47;p=xonotic%2Fxonotic.git Fix for stupid bug. --- diff --git a/misc/tools/progs-analyzer.pl b/misc/tools/progs-analyzer.pl index e8d7a212..d0df1c42 100755 --- a/misc/tools/progs-analyzer.pl +++ b/misc/tools/progs-analyzer.pl @@ -1227,12 +1227,12 @@ sub parse_progs($) my $file = $p{getstring}->($f->{s_file}); die "Out of range first_statement in function $_ (name: \"$name\", file: \"$file\", first statement: $f->{first_statement})" if $f->{first_statement} >= @{$p{statements}}; - die "Out of range parm_start in function $_ (name: \"$name\", file: \"$file\", first statement: $f->{first_statement})" - if $f->{parm_start} < 0 || $f->{parm_start} >= @{$p{globals}}; - die "Out of range locals in function $_ (name: \"$name\", file: \"$file\", first statement: $f->{first_statement})" - if $f->{locals} < 0 || $f->{parm_start} + $f->{locals} >= @{$p{globals}}; if($f->{first_statement} >= 0) { + die "Out of range parm_start in function $_ (name: \"$name\", file: \"$file\", first statement: $f->{first_statement})" + if $f->{parm_start} < 0 || $f->{parm_start} >= @{$p{globals}}; + die "Out of range locals in function $_ (name: \"$name\", file: \"$file\", first statement: $f->{first_statement})" + if $f->{locals} < 0 || $f->{parm_start} + $f->{locals} > @{$p{globals}}; die "Out of range numparms $f->{numparms} in function $_ (name: \"$name\", file: \"$file\", first statement: $f->{first_statement})" if $f->{numparms} < 0 || $f->{numparms} > 8; my $totalparms = 0; @@ -1243,7 +1243,9 @@ sub parse_progs($) $totalparms += $f->{parm_size}[$_]; } die "Out of range parms in function $_ (name: \"$name\", file: \"$file\", first statement: $f->{first_statement})" - if $f->{locals} < 0 || $f->{parm_start} + $totalparms >= @{$p{globals}}; + if $f->{parm_start} + $totalparms > @{$p{globals}}; + die "More parms than locals in function $_ (name: \"$name\", file: \"$file\", first statement: $f->{first_statement})" + if $totalparms > $f->{locals}; } }