# HG changeset patch # User Christian Kamm # Date 1217328268 -7200 # Node ID 944d43f3779fe54de7e91f83d15cf699635bb863 # Parent c8d98ccad0cc49e0635153c494fc60c1e1141413 Fix the static array cast size check. diff -r c8d98ccad0cc -r 944d43f3779f gen/arrays.cpp --- a/gen/arrays.cpp Tue Jul 29 12:32:01 2008 +0200 +++ b/gen/arrays.cpp Tue Jul 29 12:44:28 2008 +0200 @@ -988,7 +988,7 @@ 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();