From: Rudolf Polzer Date: Wed, 2 May 2012 12:38:52 +0000 (+0200) Subject: more fixes X-Git-Tag: xonotic-v0.7.0~55^2~20 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b03cfe83cea7d4172de0bef39672d90f342dd57f;p=xonotic%2Fxonotic.git more fixes --- diff --git a/misc/tools/progs-analyzer.pl b/misc/tools/progs-analyzer.pl index ee6fb82b..58792a5c 100644 --- a/misc/tools/progs-analyzer.pl +++ b/misc/tools/progs-analyzer.pl @@ -360,6 +360,14 @@ sub disassemble_function($$;$) print "$func->{debugname}:\n"; + if($func->{first_statement} < 0) # builtin + { + printf INSTRUCTION_FORMAT, '', '', '.BUILTIN'; + printf OPERAND_FORMAT, -$func->{first_statement}; + print INSTRUCTION_SEPARATOR; + return; + } + my $initializer = sub { my ($ofs) = @_; @@ -530,7 +538,6 @@ sub find_uninitialized_locals($$) { my ($progs, $func) = @_; - return if $func->{first_statement} < 0; # builtin @@ -1053,7 +1060,7 @@ sub detect_constants($) $progs->{temps} = \%istemp; # globaldefs - my @globaldefs = (undef) x @{$progs->{globaldefs}}; + my @globaldefs = (undef) x @{$progs->{globals}}; for(@{$progs->{globaldefs}}) { $globaldefs[$_->{ofs}] //= $_ @@ -1345,6 +1352,13 @@ sub parse_progs($) print STDERR "Detecting constants and temps, and naming...\n"; detect_constants \%p; + if($ENV{DUMP}) + { + use Data::Dumper; + print Dumper \%p; + return; + } + # what do we want to do? my $checkfunc = \&find_uninitialized_locals; if($ENV{DISASSEMBLE})