From 97501eaceebfe3bc39880521c1989c940c4de6a5 Mon Sep 17 00:00:00 2001 From: Damian Day Date: Fri, 20 Mar 2020 21:50:40 +0000 Subject: [PATCH] Move assert Place the assert before the allocation. --- BeefLibs/corlib/src/Collections/Generic/Queue.bf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BeefLibs/corlib/src/Collections/Generic/Queue.bf b/BeefLibs/corlib/src/Collections/Generic/Queue.bf index 98609ae5..5e8b93d0 100644 --- a/BeefLibs/corlib/src/Collections/Generic/Queue.bf +++ b/BeefLibs/corlib/src/Collections/Generic/Queue.bf @@ -51,8 +51,8 @@ namespace System.Collections.Generic [AllowAppend] public this(int capacity) { + Debug.Assert((uint)capacity <= (uint)SizeFlags); T* items = append T[capacity]* (?); - Debug.Assert(capacity >= 0); mItems = items; mHead = 0; mTail = 0;