[llvm-commits] [poolalloc] r133403 - /poolalloc/trunk/lib/AssistDS/ArgCast.cpp
Will Dietz
wdietz2 at illinois.edu
Sun Jun 19 15:12:09 PDT 2011
Author: wdietz2
Date: Sun Jun 19 17:12:09 2011
New Revision: 133403
URL: http://llvm.org/viewvc/llvm-project?rev=133403&view=rev
Log:
Replace use of potentially uninitialized variable with an assert.
This might be not be fully correct, but fixes the code compiling,
and should be better than using an uninitialized pointer.
Modified:
poolalloc/trunk/lib/AssistDS/ArgCast.cpp
Modified: poolalloc/trunk/lib/AssistDS/ArgCast.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/ArgCast.cpp?rev=133403&r1=133402&r2=133403&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/ArgCast.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/ArgCast.cpp Sun Jun 19 17:12:09 2011
@@ -185,6 +185,10 @@
RetCast = CastInst::CreatePointerCast(CINew, CI->getType(), "", CI);
else if(CI->getType()->isPointerTy() && CINew->getType()->isIntOrIntVectorTy())
RetCast = new IntToPtrInst(CINew, CI->getType(), "", CI);
+ else {
+ // TODO: I'm not sure what right behavior is here, but this case should be handled.
+ assert(0 && "Unexpected type conversion in call!");
+ }
CI->replaceAllUsesWith(RetCast);
} else {
CI->replaceAllUsesWith(CINew);
More information about the llvm-commits
mailing list