From 6da5dd96d527b03f6900ef0ed9bfdde65c48a496 Mon Sep 17 00:00:00 2001 From: Roy Stogner Date: Tue, 27 Aug 2024 08:33:38 -0500 Subject: [PATCH] Don't use allocsize uninitialized in Array(Array&&) This fixes an integer overflow error that clang++ -fsanitize caught for me, and might fix allocation failures for users with mem tracing enabled. Refs issue #188 --- libsrc/core/array.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/core/array.hpp b/libsrc/core/array.hpp index 33e8549f..9dbebde1 100644 --- a/libsrc/core/array.hpp +++ b/libsrc/core/array.hpp @@ -731,7 +731,7 @@ namespace ngcore mem_to_delete = nullptr; } - NETGEN_INLINE Array (Array && a2) + NETGEN_INLINE Array (Array && a2) : allocsize(0) { mt.Swap(sizeof(T) * allocsize, a2.mt, sizeof(T) * a2.allocsize);