From 5a559b9c0319a902e6a05b76efcae5268c5abbad Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Sat, 4 Jan 2025 10:31:25 +0100 Subject: [PATCH] corec: test array Heap has DATA_FLAG_MEMHEAP Otherwise we won't be able to read back the cc_memheap* from the p->_Begin shift. --- corec/corec/array/array.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/corec/corec/array/array.c b/corec/corec/array/array.c index deaf0489..4d62cdcc 100644 --- a/corec/corec/array/array.c +++ b/corec/corec/array/array.c @@ -126,7 +126,10 @@ void ArrayInitEx(array* p,const cc_memheap* Heap) if (Heap == NULL) p->_Begin = NULL; else + { + assert(Heap->Size & DATA_FLAG_MEMHEAP); p->_Begin = (void*)Heap->data; + } p->_Used = 0; }