From 2db51b9b00a18d1931b6888958fbc54790008050 Mon Sep 17 00:00:00 2001 From: Rerumu Date: Thu, 16 Jun 2022 01:56:42 -0400 Subject: [PATCH] Fix `realloc` failing on no-op --- codegen-luajit/runtime/runtime.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codegen-luajit/runtime/runtime.lua b/codegen-luajit/runtime/runtime.lua index 2f8d840..e04f031 100644 --- a/codegen-luajit/runtime/runtime.lua +++ b/codegen-luajit/runtime/runtime.lua @@ -518,6 +518,10 @@ do end function allocator.grow(memory, num) + if num == 0 then + return memory.min + end + local old = memory.min local new = old + num