This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]