From 10bec398bb2dafbec24c753dd3bbd40600def699 Mon Sep 17 00:00:00 2001 From: Quentin Date: Sat, 13 Apr 2024 17:41:04 +0200 Subject: [PATCH] fix(lua): fix pointer.allocate allocating the wrong number of bytes (#2941) --- src/lua/bindings/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua/bindings/memory.cpp b/src/lua/bindings/memory.cpp index ce0d07c8..c4e5a609 100644 --- a/src/lua/bindings/memory.cpp +++ b/src/lua/bindings/memory.cpp @@ -107,7 +107,7 @@ namespace lua::memory // Returns: pointer: A pointer to the newly allocated memory. static pointer allocate(int size, sol::this_state state) { - void* mem = new uint8_t[](size); + void* mem = new uint8_t[size](); big::lua_module* module = sol::state_view(state)["!this"]; module->m_allocated_memory.push_back(mem);