ldc
ldc copied to clipboard
Casting array to vector is too permissive
This compiles:
import core.simd;
auto foo()
{
int[3] arr;
return cast(int4) arr;
}
auto bar(int[] arr)
{
return cast(int4) arr;
}
In both cases, we simply memcpy the first 16 bytes - reading beyond the static array and skipping all bounds/length checks for the slice.