From 9df9f5ff58714703c3d4e19de888b85e06ef58c6 Mon Sep 17 00:00:00 2001 From: nuoun <10226424+nuoun@users.noreply.github.com> Date: Fri, 13 Dec 2024 22:56:02 +0100 Subject: [PATCH] Fixes a LuaJIT stack leak on broken generate function error return (#7921) --- src/common/dsp/WavetableScriptEvaluator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/dsp/WavetableScriptEvaluator.cpp b/src/common/dsp/WavetableScriptEvaluator.cpp index 8cf30baf249..f14d3a530f5 100644 --- a/src/common/dsp/WavetableScriptEvaluator.cpp +++ b/src/common/dsp/WavetableScriptEvaluator.cpp @@ -84,6 +84,7 @@ struct LuaWTEvaluator::Details if (storage) storage->reportError("Unable to locate generate function", "Wavetable Script Evaluator"); + lua_pop(L, 1); // pop the generate non-function return std::nullopt; } Surge::LuaSupport::setSurgeFunctionEnvironment(L);