]> granicus.if.org Git - python/commitdiff
If the for loop isn't entered, entryblock will be NULL. If passed
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 23 Jul 2006 07:51:58 +0000 (07:51 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 23 Jul 2006 07:51:58 +0000 (07:51 +0000)
to stackdepth_walk it will be dereffed.

Not sure if I found with failmalloc or Klockwork #55.

Python/compile.c

index 564df18473584ee817bd5ece2233e68ab591d769..5ed9893c8055cc0e22723127365b82d6acc38785 100644 (file)
@@ -4022,6 +4022,8 @@ stackdepth(struct compiler *c)
                b->b_startdepth = INT_MIN;
                entryblock = b;
        }
+       if (!entryblock)
+               return 0;
        return stackdepth_walk(c, entryblock, 0, 0);
 }