]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
warn on invalid opcodes if they are reached
authorRudolf Polzer <divverent@xonotic.org>
Mon, 31 Dec 2012 12:12:23 +0000 (13:12 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Mon, 31 Dec 2012 12:12:23 +0000 (13:12 +0100)
misc/tools/progs-analyzer.pl

index 75e9b84fec790f265eccfd1fe95831da8ef147ae..e8d7a21260382821c053077e18343beee5f151c2 100755 (executable)
@@ -127,6 +127,10 @@ sub checkop($)
        {
                return { a => 'inglobal', b => 'inglobalfunc' };
        }
+       if($op =~ /^INVALID#/)
+       {
+               return { isinvalid => 1 };
+       }
        return { a => 'inglobal', b => 'inglobal', c => 'outglobal' };
 }
 
@@ -675,6 +679,10 @@ sub find_uninitialized_locals($$)
                                }
                        }
 
+                       if($c->{isinvalid})
+                       {
+                               ++$warned{$ip}{''}{"Invalid opcode"};
+                       }
                        for(qw(a b c))
                        {
                                my $type = $c->{$_};