From 60c4acc1a072268c59d32d007feb78dfe5f2acba Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 4 Jun 2015 15:55:37 +0200 Subject: [PATCH] Fix detection of setorigin/setsize/setmodel. --- misc/tools/progs-analyzer.pl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/misc/tools/progs-analyzer.pl b/misc/tools/progs-analyzer.pl index af97908d..20342168 100755 --- a/misc/tools/progs-analyzer.pl +++ b/misc/tools/progs-analyzer.pl @@ -296,9 +296,8 @@ sub run_nfa($$$$$$) elsif($c->{iscall}) { my $func = $s->{a}; - my $funcid = $progs->{globals}[$func]{v}{int}; last - if $progs->{builtins}{error}{$funcid}; + if $progs->{builtins}{error}{$func}; $ip += 1; } elsif($c->{isjump}) @@ -918,8 +917,7 @@ sub find_uninitialized_locals($$) { # TODO check if the entity passed is actually the one on which solid was set. my $func = $s->{a}; - my $funcid = $progs->{globals}[$func]{v}{int}; - if ($progs->{builtins}{setmodel}{$funcid} || $progs->{builtins}{setsize}{$funcid}) + if ($progs->{builtins}{setmodel}{$func} || $progs->{builtins}{setorigin}{$func} || $progs->{builtins}{setsize}{$func}) { # All is clean. $$state = -1; @@ -929,7 +927,8 @@ sub find_uninitialized_locals($$) if($c->{isreturn}) { if ($$state >= 0) { - ++$warned{$$state}{''}{"Changing .solid without setmodel/setsize breaks area grid linking in Quake"}; + ++$warned{$$state}{''}{"Changing .solid without setmodel/setsize breaks area grid linking in Quake (write is here)"}; + ++$warned{$ip}{''}{"Changing .solid without setmodel/setsize breaks area grid linking in Quake (return is here)"}; } } @@ -1414,8 +1413,8 @@ sub parse_progs($$) } } - print STDERR "Looking for error(), setmodel(), setsize()...\n"; - $p{builtins} = { error => {}, setmodel => {}, setsize => {} }; + print STDERR "Looking for error(), setmodel(), setorigin(), setsize()...\n"; + $p{builtins} = { error => {}, setmodel => {}, setorigin => {}, setsize => {} }; for(@{$p{globaldefs}}) { my $name = $p{getstring}($_->{s_name}); -- 2.39.2