mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 08:01:11 +03:00
Fix ICE for ref/out params of opaque structs
Fixes dmd-testsuite's new compilable/test21668.d.
This commit is contained in:
parent
3abffca14c
commit
52bcbcc566
3 changed files with 25 additions and 13 deletions
|
@ -152,7 +152,9 @@ void DtoDeleteArray(const Loc &loc, DValue *arr) {
|
|||
unsigned DtoAlignment(Type *type) {
|
||||
structalign_t alignment = type->alignment();
|
||||
if (alignment == STRUCTALIGN_DEFAULT) {
|
||||
alignment = type->alignsize();
|
||||
auto ts = type->toBasetype()->isTypeStruct();
|
||||
if (!ts || ts->sym->members) // not an opaque struct
|
||||
alignment = type->alignsize();
|
||||
}
|
||||
return (alignment == STRUCTALIGN_DEFAULT ? 0 : alignment);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue