summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-01 19:14:51 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-01 19:14:51 +0000
commit26c642de74af98708b87d7210e6ad9f4fc91c56d (patch)
tree2d82b5235ab2cccae7671a442b9f8d5ee9094591 /llvm/lib
parentce494229a1faad96a0c48bd93decea42024b2e15 (diff)
downloadbcm5719-llvm-26c642de74af98708b87d7210e6ad9f4fc91c56d.tar.gz
bcm5719-llvm-26c642de74af98708b87d7210e6ad9f4fc91c56d.zip
Ensure that ConvertOperandToType generates a result conversion by
initializing the Res variable to 0 and asserting it is not zero after the result should have been created. llvm-svn: 33761
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/ExprTypeConvert.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/ExprTypeConvert.cpp b/llvm/lib/Transforms/ExprTypeConvert.cpp
index ee5549bad2d..259aa67011c 100644
--- a/llvm/lib/Transforms/ExprTypeConvert.cpp
+++ b/llvm/lib/Transforms/ExprTypeConvert.cpp
@@ -697,7 +697,7 @@ static void ConvertOperandToType(User *U, Value *OldVal, Value *NewVal,
assert(BB != 0 && "Instruction not embedded in basic block!");
std::string Name = I->getName();
I->setName("");
- Instruction *Res; // Result of conversion
+ Instruction *Res = 0; // Result of conversion
//cerr << endl << endl << "Type:\t" << Ty << "\nInst: " << I
// << "BB Before: " << BB << endl;
@@ -917,6 +917,8 @@ static void ConvertOperandToType(User *U, Value *OldVal, Value *NewVal,
return;
}
+ assert(Res != 0 && "We didn't get a result conversion?");
+
// If the instruction was newly created, insert it into the instruction
// stream.
//
OpenPOWER on IntegriCloud