From 38aa07476763fa0f58dd75f6165f90f5bacb6000 Mon Sep 17 00:00:00 2001 From: Vighnesh Date: Fri, 12 Jan 2024 14:11:40 -0800 Subject: [PATCH] resolve memory leak in VecDeque --- Common/include/Luau/VecDeque.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/include/Luau/VecDeque.h b/Common/include/Luau/VecDeque.h index c2fbc94d..37c0ca48 100644 --- a/Common/include/Luau/VecDeque.h +++ b/Common/include/Luau/VecDeque.h @@ -54,7 +54,7 @@ private: size_t tail_size = queue_size - head_size; // how many elements are in the tail portion (i.e. any portion that wrapped to the front) // we have to destroy every element in the head portion - for (size_t index = head; index < head_size; index++) + for (size_t index = head; index < head + head_size; index++) buffer[index].~T(); // and any in the tail portion, if one exists