From 7cd3520424728d234b9eab76e6ae0b974fc29c28 Mon Sep 17 00:00:00 2001 From: sundb Date: Wed, 3 Aug 2022 13:03:13 +0800 Subject: [PATCH] Return ASAP when lua error is string (#11075) This is a harmless optimization/bug. When the top of the lua stack is a string, we should not continue to use lua_getfield to get the table fields. --- src/script_lua.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/script_lua.c b/src/script_lua.c index 29edf344b..736ddc949 100644 --- a/src/script_lua.c +++ b/src/script_lua.c @@ -1553,6 +1553,7 @@ void luaExtractErrorInformation(lua_State *lua, errorInfo *err_info) { err_info->line = NULL; err_info->source = NULL; err_info->ignore_err_stats_update = 0; + return; } lua_getfield(lua, -1, "err");