changeset 910:4c02b41b3dc6

Remove asserts on array consistancy in arraysetlength. Fixes #184, thanks Deewiant.
author Christian Kamm <kamm incasoftware de>
date Thu, 29 Jan 2009 17:45:12 +0100
parents 52dad07846be
children 1d9fe5e2a13c
files runtime/internal/lifetime.d
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/internal/lifetime.d	Thu Jan 29 17:19:48 2009 +0100
+++ b/runtime/internal/lifetime.d	Thu Jan 29 17:45:12 2009 +0100
@@ -607,7 +607,9 @@
 in
 {
     assert(ti);
-    assert(!plength || pdata);
+// This assert on array consistency may fail with casts or in unions.
+// This function still does something sensible even if plength && !pdata. 
+//    assert(!plength || pdata);
 }
 body
 {
@@ -698,7 +700,9 @@
 extern (C) byte* _d_arraysetlengthiT(TypeInfo ti, size_t newlength, size_t plength, byte* pdata)
 in
 {
-    assert(!plength || pdata);
+// This assert on array consistency may fail with casts or in unions.
+// This function still does something sensible even if plength && !pdata. 
+//    assert(!plength || pdata);
 }
 body
 {