changeset 425:944d43f3779f

Fix the static array cast size check.
author Christian Kamm <kamm incasoftware de>
date Tue, 29 Jul 2008 12:44:28 +0200
parents c8d98ccad0cc
children e763821ab244
files gen/arrays.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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();