Uninitialised memory read in gcc-2.95.2/gcc/lcm.c, another one

Martin Stromberg Martin.Stromberg@lu.erisoft.se
Sun Mar 12 07:42:00 GMT 2000


After allocating with sbitmap_vector_alloc(), it seems you're supposed
to initialise what has been allocated as sbitmap_vector_alloc()
doesn't.

gcc-2.95.2/gcc/lcm.c misses that at line 427. 

Patch:
diff -ru gcc-2.95.2.org/gcc/lcm.c gcc-2.95.2/gcc/lcm.c
--- gcc-2.95.2.org/gcc/lcm.c    Wed Mar 10 23:03:35 1999
+++ gcc-2.95.2/gcc/lcm.c        Sun Mar 12 15:12:58 2000
@@ -424,6 +424,7 @@
   /* This is constant throughout the flow equations below, so compute
      it once to save time.  */
   anti_and_early = sbitmap_vector_alloc (n_blocks, n_exprs);
+  sbitmap_vector_zero (anti_and_early, n_exprs);
   for (bb = 0; bb < n_blocks; bb++)
     sbitmap_a_and_b (anti_and_early[bb], antin[bb], earlyin[bb]);
   

U2, October,

							MartinS


More information about the Gcc-bugs mailing list