]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
fix detection of error()
authorRudolf Polzer <divverent@xonotic.org>
Thu, 26 Apr 2012 11:35:56 +0000 (13:35 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 26 Apr 2012 11:35:56 +0000 (13:35 +0200)
misc/tools/progs-analyzer.pl

index 91eb67f13f7bb4d2b414fe1d9ba51504cc7e644e..df803b7c22b8d0676f85e043bd3415c7a5cda3a0 100644 (file)
@@ -686,7 +686,7 @@ sub find_uninitialized_locals($$)
                                my $func = $s->{a};
                                my $funcid = $progs->{globals}[$func]{v}{int};
                                my $funcobj = $progs->{functions}[$funcid];
-                               if($funcobj->{first_statement} >= 0)
+                               if(!$funcobj || $funcobj->{first_statement} >= 0)
                                {
                                        # invalidate temps
                                        for(values %$state)
@@ -697,9 +697,11 @@ sub find_uninitialized_locals($$)
                                                }
                                        }
                                }
-                               elsif($funcobj->{debugname} =~ /(^|:)error$/)
+                               else # builtin
                                {
-                                       return 1;
+                                       my $def = $progs->{globaldef_byoffset}->($func);
+                                       return 1
+                                               if $def->{debugname} eq 'error';
                                }
                        }