mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
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:
@@ -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);
|
||||
|
||||
Submodule tests/d2/dmd-testsuite updated: 72fc92aaa4...fcbbac48a0
Reference in New Issue
Block a user