mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-09 16:33:14 +01:00
Fix the static array cast size check.
This commit is contained in:
@@ -988,7 +988,7 @@ DValue* DtoCastArray(Loc& loc, DValue* u, Type* to)
|
||||
assert(isaPointer(uval->getType()));
|
||||
const LLArrayType* arrty = isaArray(uval->getType()->getContainedType(0));
|
||||
|
||||
if(arrty->getNumElements() % totype->next->size() != 0)
|
||||
if(arrty->getNumElements()*fromtype->next->size() % totype->next->size() != 0)
|
||||
{
|
||||
error(loc, "invalid cast from '%s' to '%s', the element sizes don't line up", fromtype->toChars(), totype->toChars());
|
||||
fatal();
|
||||
|
||||
Reference in New Issue
Block a user