Fix bug: FunctionResolve/2003-05-21-MissingArguments.ll
authorChris Lattner <sabre@nondot.org>
Wed, 21 May 2003 20:51:52 +0000 (20:51 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 21 May 2003 20:51:52 +0000 (20:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6273 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/FunctionResolution.cpp

index 1b1065e3e926da092b31307e1cc9c094ae687b5a..861e8106014c524ee9866052f83a51d85c079250 100644 (file)
@@ -76,6 +76,11 @@ static void ConvertCallTo(CallInst *CI, Function *Dest) {
 
     Params.push_back(V);
   }
+  
+  // If the function takes extra parameters that are not being passed in, pass
+  // null values in now...
+  for (unsigned i = NumArgsToCopy; i < ParamTys.size(); ++i)
+    Params.push_back(Constant::getNullValue(ParamTys[i]));
 
   // Replace the old call instruction with a new call instruction that calls
   // the real function.