From 2cfcfd911382d278ada4cab9e0edef44d4485e80 Mon Sep 17 00:00:00 2001 From: xposure Date: Mon, 4 Jan 2021 20:43:03 -0500 Subject: [PATCH] adding comment on ArrayType CreateObject for count > 1 --- BeefLibs/corlib/src/Type.bf | 1 + 1 file changed, 1 insertion(+) diff --git a/BeefLibs/corlib/src/Type.bf b/BeefLibs/corlib/src/Type.bf index c32bb5c7..db556780 100644 --- a/BeefLibs/corlib/src/Type.bf +++ b/BeefLibs/corlib/src/Type.bf @@ -1120,6 +1120,7 @@ namespace System.Reflection obj = Internal.UnsafeCastToObject(mem); obj.[Friend]mClassVData = (.)(void*)[Friend]mTypeClassVData; #endif + //Array1 holds the first element, we only want to set the remaining elements if(count > 1) Internal.MemSet((uint8*)Internal.UnsafeCastToPtr(obj) + [Friend]mInstSize, 0, [Friend]arraySize - [Friend]mInstSize); var array = (Array)obj;