From 550cadbee47fc31acfff08e805403d214e2d05ce Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 22 Jan 2024 14:07:33 -0500 Subject: [PATCH] device_memory_manager: fix ScratchBuffer indexing --- src/core/device_memory_manager.inc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/device_memory_manager.inc b/src/core/device_memory_manager.inc index 8ce1228729..eab8a27318 100644 --- a/src/core/device_memory_manager.inc +++ b/src/core/device_memory_manager.inc @@ -31,9 +31,8 @@ public: buffer.resize(0); size_t index = 0; const auto add_value = [&](u32 value) { - buffer[index] = value; - index++; - buffer.resize(index); + buffer.resize(index + 1); + buffer[index++] = value; }; u32 iter_entry = start_entry;