aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/ExprTypeConvert.cpp
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
commit8282e3f92b9ba140ad8fbf0fae29c79161128111 (patch)
tree7e07098ed8add78fc2bc1cbc3b444e2a75bda19d /lib/Transforms/ExprTypeConvert.cpp
parent8e8eda78cc5f06e4b19f2c374189a25017085286 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33761 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/ExprTypeConvert.cpp')
-rw-r--r--lib/Transforms/ExprTypeConvert.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp
index ee5549bad2..259aa67011 100644
--- a/lib/Transforms/ExprTypeConvert.cpp
+++ b/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.
//