summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAxel Naumann <Axel.Naumann@cern.ch>2012-09-17 14:20:57 +0000
committerAxel Naumann <Axel.Naumann@cern.ch>2012-09-17 14:20:57 +0000
commit3780ad8b998d93d7db406919c06137cdb786ef05 (patch)
tree201909f47db287382b23073c83ecf72d1dbfb4c6
parentc8bf0f86624f025ca7c2b5cfc35ef3fb904a3930 (diff)
downloadllvm-3780ad8b998d93d7db406919c06137cdb786ef05.tar.gz
llvm-3780ad8b998d93d7db406919c06137cdb786ef05.tar.bz2
llvm-3780ad8b998d93d7db406919c06137cdb786ef05.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164032 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Instrumentation/AddressSanitizer.cpp2
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp2
-rw-r--r--utils/yaml2obj/yaml2obj.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index 0775cf4a22..afa6a4b5e6 100644
--- a/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -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) {
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index e7b5bc779a..091d63d67d 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -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()) {
diff --git a/utils/yaml2obj/yaml2obj.cpp b/utils/yaml2obj/yaml2obj.cpp
index c3b3e5499c..4fc620f4ea 100644
--- a/utils/yaml2obj/yaml2obj.cpp
+++ b/utils/yaml2obj/yaml2obj.cpp
@@ -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);