OSDN Git Service

[JIT] Fix uninitialized read (issue #4929028)
authorbuzbee <buzbee@google.com>
Thu, 23 Jun 2011 22:20:56 +0000 (15:20 -0700)
committerbuzbee <buzbee@google.com>
Thu, 23 Jun 2011 22:47:44 +0000 (15:47 -0700)
Found via Valgrind.  This should not have caused any bad code to be
generated in this case, but good to fix.  Use arrays cleared on creation.

Change-Id: I5f87c6ec74e12b9c99835695b71b6ee49505503a

vm/compiler/SSATransformation.cpp

index 091ed13..542fff5 100644 (file)
@@ -535,7 +535,7 @@ static bool insertPhiNodeOperands(CompilationUnit *cUnit, BasicBlock *bb)
         mir->ssaRep->uses =
             (int *) dvmCompilerNew(sizeof(int) * numUses, false);
         mir->ssaRep->fpUse =
-            (bool *) dvmCompilerNew(sizeof(bool) * numUses, false);
+            (bool *) dvmCompilerNew(sizeof(bool) * numUses, true);
 
         BitVectorIterator phiIterator;