aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
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
commit4724e814ee4e17f54625c2db27a4916329ca734a (patch)
tree0e8809cbba1b3d5c67ee164427bbf97dd54026f1 /lib/Transforms
parentd980e346fb9e67fa015ea48d9636f76707647c30 (diff)
downloadexternal_llvm-4724e814ee4e17f54625c2db27a4916329ca734a.zip
external_llvm-4724e814ee4e17f54625c2db27a4916329ca734a.tar.gz
external_llvm-4724e814ee4e17f54625c2db27a4916329ca734a.tar.bz2
don't assume that the argument passed to fprintf("%s" is a string. This
fixes a crash in opt on 433.milc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50023 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/IPO/SimplifyLibCalls.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/SimplifyLibCalls.cpp b/lib/Transforms/IPO/SimplifyLibCalls.cpp
index 6e4ac5a..10393bc 100644
--- a/lib/Transforms/IPO/SimplifyLibCalls.cpp
+++ b/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)