mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-07-06 15:34:10 +02:00
Do not unnecessarily call postblit after rvalue array initializers.
Fixes DMD testcases 'sdtor' and 'structlit'.
This commit is contained in:
@@ -397,7 +397,7 @@ void DtoLeaveMonitor(LLValue* v)
|
||||
|
||||
// is this a good approach at all ?
|
||||
|
||||
void DtoAssign(Loc& loc, DValue* lhs, DValue* rhs, int op)
|
||||
void DtoAssign(Loc& loc, DValue* lhs, DValue* rhs, int op, bool canSkipPostblit)
|
||||
{
|
||||
Logger::println("DtoAssign()");
|
||||
LOG_SCOPE;
|
||||
@@ -424,7 +424,9 @@ void DtoAssign(Loc& loc, DValue* lhs, DValue* rhs, int op)
|
||||
else if (DtoArrayElementType(t)->equals(stripModifiers(t2))) {
|
||||
DtoArrayInit(loc, s, rhs, op);
|
||||
}
|
||||
else if (op != -1 && op != TOKblit && arrayNeedsPostblit(t)) {
|
||||
else if (op != -1 && op != TOKblit && !canSkipPostblit &&
|
||||
arrayNeedsPostblit(t)
|
||||
) {
|
||||
DtoArrayAssign(s, rhs, op);
|
||||
}
|
||||
#endif
|
||||
@@ -462,7 +464,9 @@ void DtoAssign(Loc& loc, DValue* lhs, DValue* rhs, int op)
|
||||
else if (DtoArrayElementType(t)->equals(stripModifiers(t2))) {
|
||||
DtoArrayInit(loc, lhs, rhs, op);
|
||||
}
|
||||
else if (op != -1 && op != TOKblit && arrayNeedsPostblit(t)) {
|
||||
else if (op != -1 && op != TOKblit && !canSkipPostblit &&
|
||||
arrayNeedsPostblit(t)
|
||||
) {
|
||||
DtoArrayAssign(lhs, rhs, op);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user