Fix handling of NewExpression for structs with constructors.

The frontend treats the constructor as returning a reference to
the new instance, we just want the memory, i.e. a pointer.

GitHub: Fixes #246.
This commit is contained in:
David Nadlinger
2012-12-19 20:57:52 +01:00
parent db59b30eda
commit fb363972f0
2 changed files with 2 additions and 2 deletions

View File

@@ -2029,7 +2029,7 @@ DValue* NewExp::toElem(IRState* p)
assert(arguments != NULL);
member->codegen(Type::sir);
DFuncValue dfn(member, member->ir.irFunc->func, mem);
return DtoCallFunction(loc, ts, &dfn, arguments);
DtoCallFunction(loc, ts, &dfn, arguments);
}
#endif
return new DImValue(type, mem);