[llvm-commits] [llvm] r164032 - in /llvm/trunk: lib/Transforms/Instrumentation/AddressSanitizer.cpp lib/Transforms/Utils/SimplifyCFG.cpp utils/yaml2obj/yaml2obj.cpp

Axel Naumann Axel.Naumann at cern.ch
Mon Sep 17 07:20:57 PDT 2012


Author: axel
Date: Mon Sep 17 09:20:57 2012
New Revision: 164032

URL: http://llvm.org/viewvc/llvm-project?rev=164032&view=rev
Log:
Fix a few vars that can end up being used without initialization.
The cases where no initialization happens should still be checked for logic flaws.

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
    llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
    llvm/trunk/utils/yaml2obj/yaml2obj.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=164032&r1=164031&r2=164032&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Mon Sep 17 09:20:57 2012
@@ -392,7 +392,7 @@
 }
 
 void AddressSanitizer::instrumentMop(AsanFunctionContext &AFC, Instruction *I) {
-  bool IsWrite;
+  bool IsWrite = false;
   Value *Addr = isInterestingMemoryAccess(I, &IsWrite);
   assert(Addr);
   if (ClOpt && ClOptGlobals) {

Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=164032&r1=164031&r2=164032&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Mon Sep 17 09:20:57 2012
@@ -1796,7 +1796,7 @@
       continue;
 
     // Determine if the two branches share a common destination.
-    Instruction::BinaryOps Opc;
+    Instruction::BinaryOps Opc = Instruction::BinaryOpsEnd;
     bool InvertPredCond = false;
 
     if (BI->isConditional()) {

Modified: llvm/trunk/utils/yaml2obj/yaml2obj.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/yaml2obj/yaml2obj.cpp?rev=164032&r1=164031&r2=164032&view=diff
==============================================================================
--- llvm/trunk/utils/yaml2obj/yaml2obj.cpp (original)
+++ llvm/trunk/utils/yaml2obj/yaml2obj.cpp Mon Sep 17 09:20:57 2012
@@ -148,7 +148,7 @@
           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);





More information about the llvm-commits mailing list