]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
detect NOP jumps, and trivial endless loop
authorRudolf Polzer <divverent@alientrap.org>
Wed, 30 May 2012 12:58:10 +0000 (14:58 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Wed, 30 May 2012 12:58:10 +0000 (14:58 +0200)
misc/tools/progs-analyzer.pl

index 6ba7de89c4d8ba6d912059d51f34728ea3c317a4..061f4485b2de42a668ad9a466788af0beca1ab01 100644 (file)
@@ -741,6 +741,13 @@ sub find_uninitialized_locals($$)
                                        $write->($ofs+1);
                                        $write->($ofs+2);
                                }
+                               elsif($type eq 'ipoffset')
+                               {
+                                       push @{$warned{$ip}{$_}}, "Endless loop"
+                                               if $ofs == 0;
+                                       push @{$warned{$ip}{$_}}, "No-operation jump"
+                                               if $ofs == 1;
+                               }
                        }
                        if($c->{iscall})
                        {