Mercurial > projects > ldc
diff gen/tocall.cpp @ 1178:a668f4051368
Fix a bug I noticed. Varargs were broken if preceded by tuple parameters.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Mon, 30 Mar 2009 00:00:43 +0200 |
parents | 5ebe8224988b |
children | 83d3b25c2213 |
line wrap: on
line diff
--- a/gen/tocall.cpp Sun Mar 29 23:57:51 2009 +0200 +++ b/gen/tocall.cpp Mon Mar 30 00:00:43 2009 +0200 @@ -122,11 +122,12 @@ void DtoBuildDVarArgList(std::vector<LLValue*>& args, std::vector<llvm::AttributeWithIndex>& attrs, TypeFunction* tf, Expressions* arguments, size_t argidx) { Logger::println("doing d-style variadic arguments"); + LOG_SCOPE std::vector<const LLType*> vtypes; // number of non variadic args - int begin = tf->parameters->dim; + int begin = Argument::dim(tf->parameters); Logger::println("num non vararg params = %d", begin); // get n args in arguments list @@ -136,6 +137,7 @@ for (int i=begin; i<n_arguments; i++) { Expression* argexp = (Expression*)arguments->data[i]; + assert(argexp->type->ty != Ttuple); vtypes.push_back(DtoType(argexp->type)); size_t sz = getTypePaddedSize(vtypes.back()); if (sz < PTRSIZE)