Fix a few vars that can end up being used without initialization.
authorAxel Naumann <Axel.Naumann@cern.ch>
Mon, 17 Sep 2012 14:20:57 +0000 (14:20 +0000)
committerAxel Naumann <Axel.Naumann@cern.ch>
Mon, 17 Sep 2012 14:20:57 +0000 (14:20 +0000)
The cases where no initialization happens should still be checked for logic flaws.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164032 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/AddressSanitizer.cpp
lib/Transforms/Utils/SimplifyCFG.cpp
utils/yaml2obj/yaml2obj.cpp

index 0775cf4a224ea8fe2b6f1f5903ffc608efe08507..afa6a4b5e67ed2621a9517428e38acd4efb8ffc7 100644 (file)
@@ -392,7 +392,7 @@ bool AddressSanitizer::HasDynamicInitializer(GlobalVariable *G) {
 }
 
 void AddressSanitizer::instrumentMop(AsanFunctionContext &AFC, Instruction *I) {
-  bool IsWrite;
+  bool IsWrite = false;
   Value *Addr = isInterestingMemoryAccess(I, &IsWrite);
   assert(Addr);
   if (ClOpt && ClOptGlobals) {
index e7b5bc779a3b98b7da072cd234cab4b91b44fcd7..091d63d67db583a201241e8fd479d4f98d1e8f89 100644 (file)
@@ -1796,7 +1796,7 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI) {
       continue;
 
     // Determine if the two branches share a common destination.
-    Instruction::BinaryOps Opc;
+    Instruction::BinaryOps Opc = Instruction::BinaryOpsEnd;
     bool InvertPredCond = false;
 
     if (BI->isConditional()) {
index c3b3e5499cded06a4d4038abe9324ede265dc3bc..4fc620f4ea9b506ecaf7e3a477d1bc1a468986a2 100644 (file)
@@ -148,7 +148,7 @@ struct COFFParser {
           return false;
         }
         if (KeyValue == "Machine") {
-          uint16_t Machine;
+          uint16_t Machine = COFF::MT_Invalid;
           if (!getAs(Value, Machine)) {
             // It's not a raw number, try matching the string.
             StringRef ValueValue = Value->getValue(Storage);