summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-21 03:18:33 +0000
committerChris Lattner <sabre@nondot.org>2008-04-21 03:18:33 +0000
commitad0d42ba15cffd331b5750bde4444d4ba32138a7 (patch)
treecb504ae86244406e9ad52fa674c17e3044745038
parentf6236cc2e945bf101bd5082c43bb5837d6d4a26a (diff)
downloadbcm5719-llvm-ad0d42ba15cffd331b5750bde4444d4ba32138a7.tar.gz
bcm5719-llvm-ad0d42ba15cffd331b5750bde4444d4ba32138a7.zip
don't assume that the argument passed to fprintf("%s" is a string. This
fixes a crash in opt on 433.milc. llvm-svn: 50023
-rw-r--r--llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp b/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
index 6e4ac5ae4ae..10393bc3c6d 100644
--- a/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
@@ -1390,7 +1390,7 @@ public:
// If the result of the fprintf call is used, we can't do this.
// TODO: we should insert a strlen call.
- if (!CI->use_empty())
+ if (!CI->use_empty() || !isa<PointerType>(CI->getOperand(3)->getType()))
return false;
// fprintf(file,"%s",str) -> fputs(str,file)
OpenPOWER on IntegriCloud