Skip to content

Commit b5f7bb0

Browse files
kubo39thewilsonator
authored andcommitted
Followup GH-4993: drop vector-cast for casting fat values
1 parent 3dd59d0 commit b5f7bb0

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

gen/llvmhelpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ DValue *DtoCastStruct(Loc loc, DValue *val, Type *to) {
675675

676676
// A cast between fat values is possible only when the sizes match.
677677
// https://github.com/ldc-developers/ldc/issues/4993
678-
if (totype->ty == TY::Tsarray || totype->ty == TY::Tvector) {
678+
if (totype->ty == TY::Tsarray) {
679679
if (size(totype) == size(val->type->toBasetype())) {
680680
llvm::Value *lval = DtoLVal(val);
681681
return new DLValue(to, lval);

tests/compilable/gh4993.d

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,7 @@
22

33
struct Foo {}
44

5-
struct Bar
6-
{
7-
int[4] v;
8-
}
9-
105
void main() {
116
Foo f;
127
auto x = cast(ubyte[Foo.sizeof])f;
13-
14-
Bar b;
15-
auto y = cast(__vector(int[4]))b;
168
}

0 commit comments

Comments
 (0)