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.
This commit is contained in:
sundb 2022-08-03 13:03:13 +08:00 committed by GitHub
parent beb9746a9f
commit 7cd3520424
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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");