From 5df5e2abe720ca81a391eea20695afdfa10fc1a0 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 1 Apr 2018 14:35:49 +0300 Subject: [PATCH] Fixed excessive growth of ACS string pool This fixes usage of uninitialized variable in ACSStringPool::PoolEntry objects The initial version (before 66d15dc) increased pool size by one entry and assign all its members right after that The improved version reserved MIN_GC_SIZE entries but didn't initialize anything except the first one ACSStringPool::FindFirstFreeEntry() cannot find the proper entry as it uses PoolEntry::Next member for list traversal It's enough to initialize Next member with FREE_ENTRY value because other fields will be assigned anyway inside ACSStringPool::InsertString() https://forum.zdoom.org/viewtopic.php?t=60049 --- src/p_acs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_acs.h b/src/p_acs.h index 8ccf62982..fc361a230 100644 --- a/src/p_acs.h +++ b/src/p_acs.h @@ -129,7 +129,7 @@ private: { FString Str; unsigned int Hash; - unsigned int Next; + unsigned int Next = FREE_ENTRY; bool Mark; TArray Locks;