print warning with instruction

This commit is contained in:
Rudolf Polzer 2012-05-02 10:34:00 +02:00
parent 99737dee77
commit b6f053a531

View File

@ -484,6 +484,20 @@ sub disassemble_function($$;$)
my $ipt = $progs->{statements}[$ip]; my $ipt = $progs->{statements}[$ip];
my $opprop = checkop $op; my $opprop = checkop $op;
if($highlight and $highlight->{$ip})
{
for(values %{$highlight->{$ip}})
{
for(@$_)
{
print PRE_MARK_STATEMENT;
printf INSTRUCTION_FORMAT, '', '', '.WARN';
printf OPERAND_FORMAT, "$_ (in $func->{debugname})";
print INSTRUCTION_SEPARATOR;
}
}
}
print PRE_MARK_STATEMENT print PRE_MARK_STATEMENT
if $highlight and $highlight->{$ip}; if $highlight and $highlight->{$ip};
@ -694,8 +708,7 @@ sub find_uninitialized_locals($$)
# COMPILER BUG of FTEQCC: AND and OR may take uninitialized as second argument (logicops) # COMPILER BUG of FTEQCC: AND and OR may take uninitialized as second argument (logicops)
if($return_hack <= 2 and ($op ne 'OR' && $op ne 'AND' || $_ ne 'b')) if($return_hack <= 2 and ($op ne 'OR' && $op ne 'AND' || $_ ne 'b'))
{ {
print "; Use of uninitialized value $ofs in $func->{debugname} at $ip.$_\n"; push @{$warned{$ip}{$_}}, "Use of uninitialized value";
++$warned{$ip}{$_};
} }
} }
elsif($valid->[0] < 0) elsif($valid->[0] < 0)
@ -703,8 +716,7 @@ sub find_uninitialized_locals($$)
# COMPILER BUG of FTEQCC: AND and OR may take uninitialized as second argument (logicops) # COMPILER BUG of FTEQCC: AND and OR may take uninitialized as second argument (logicops)
if($return_hack <= 2 and ($op ne 'OR' && $op ne 'AND' || $_ ne 'b')) if($return_hack <= 2 and ($op ne 'OR' && $op ne 'AND' || $_ ne 'b'))
{ {
print "; Use of temporary $ofs across CALL in $func->{debugname} at $ip.$_\n"; push @{$warned{$ip}{$_}}, "Use of temporary across CALL";
++$warned{$ip}{$_};
} }
} }
else else
@ -831,8 +843,7 @@ sub find_uninitialized_locals($$)
if(!$isread) if(!$isread)
{ {
print "; Value is never used in $func->{debugname} at $ip.$operand\n"; push @{$warned{$ip}{$operand}}, "Value is never used";
++$warned{$ip}{$operand};
} }
} }
} }