mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-25 17:13:14 +01:00
Fixed test runnable/arrayop
This commit is contained in:
@@ -353,10 +353,10 @@ Expression *BinExp::arrayOp(Scope *sc)
|
||||
fd = new FuncDeclaration(0, 0, Lexer::idPool(name), STCundefined, ftype);
|
||||
fd->fbody = fbody;
|
||||
fd->protection = PROTpublic;
|
||||
fd->linkage = LINKd;
|
||||
fd->linkage = LINKd;
|
||||
|
||||
// special attention for array ops
|
||||
fd->isArrayOp = true;
|
||||
// special attention for array ops
|
||||
fd->isArrayOp = true;
|
||||
|
||||
sc->module->importedFrom->members->push(fd);
|
||||
|
||||
|
||||
@@ -424,13 +424,29 @@ DValue* DtoCallFunction(Loc& loc, Type* resulttype, DValue* fnval, Expressions*
|
||||
|
||||
LLSmallVector<unsigned, 10> attrptr(n, 0);
|
||||
|
||||
std::vector<DValue*> argvals;
|
||||
if (dfnval && dfnval->func->isArrayOp) {
|
||||
// slightly different approach for array operators
|
||||
for (int i=n-1; i>=0; --i) {
|
||||
Parameter* fnarg = Parameter::getNth(tf->parameters, i);
|
||||
assert(fnarg);
|
||||
DValue* argval = DtoArgument(fnarg, (Expression*)arguments->data[i]);
|
||||
argvals.insert(argvals.begin(), argval);
|
||||
}
|
||||
} else {
|
||||
for (int i=0; i<n; ++i) {
|
||||
Parameter* fnarg = Parameter::getNth(tf->parameters, i);
|
||||
assert(fnarg);
|
||||
DValue* argval = DtoArgument(fnarg, (Expression*)arguments->data[i]);
|
||||
argvals.push_back(argval);
|
||||
}
|
||||
}
|
||||
|
||||
// do formal params
|
||||
int beg = argiter-argbegin;
|
||||
for (int i=0; i<n; i++)
|
||||
{
|
||||
Parameter* fnarg = Parameter::getNth(tf->parameters, i);
|
||||
assert(fnarg);
|
||||
DValue* argval = DtoArgument(fnarg, (Expression*)arguments->data[i]);
|
||||
DValue* argval = argvals.at(i);
|
||||
|
||||
#if 0
|
||||
if (Logger::enabled()) {
|
||||
|
||||
Reference in New Issue
Block a user