[llvm-commits] [llvm] r50023 - /llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp

Chris Lattner sabre at nondot.org
Sun Apr 20 20:18:36 PDT 2008


Author: lattner
Date: Sun Apr 20 22:18:33 2008
New Revision: 50023

URL: http://llvm.org/viewvc/llvm-project?rev=50023&view=rev
Log:
don't assume that the argument passed to fprintf("%s"  is a string.  This 
fixes a crash in opt on 433.milc.

Modified:
    llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp

Modified: llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp?rev=50023&r1=50022&r2=50023&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp Sun Apr 20 22:18:33 2008
@@ -1390,7 +1390,7 @@
       
       // 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)





More information about the llvm-commits mailing list