Mercurial > projects > ldc
diff gen/arrays.cpp @ 1441:a3af393d1936
Error on invalid array cast. See DMD3041.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 31 May 2009 15:07:04 +0200 |
parents | 44c8eef6e6ee |
children | a5526b7a5ae6 |
line wrap: on
line diff
--- a/gen/arrays.cpp Sun May 31 14:27:01 2009 +0200 +++ b/gen/arrays.cpp Sun May 31 15:07:04 2009 +0200 @@ -894,7 +894,10 @@ Type* totype = to->toBasetype(); Type* fromtype = u->getType()->toBasetype(); - assert(fromtype->ty == Tarray || fromtype->ty == Tsarray); + if (fromtype->ty != Tarray && fromtype->ty != Tsarray) { + error(loc, "can't cast %s to %s", u->getType()->toChars(), to->toChars()); + fatal(); + } LLValue* rval; LLValue* rval2;