aboutsummaryrefslogtreecommitdiff
path: root/lib/lua/src/ldo.c
diff options
context:
space:
mode:
authorJude Melton-Houghton <jwmhjwmh@gmail.com>2022-09-26 07:23:48 -0400
committerGitHub <noreply@github.com>2022-09-26 07:23:48 -0400
commit03428d9825cfdf2cfaed6ac9410dafccac0d4f3a (patch)
tree3f6bacfa9e074e6e523698a10b0195349612eaa8 /lib/lua/src/ldo.c
parentf916398a541dbd09cbf14409f358556bc42f5535 (diff)
downloadminetest-03428d9825cfdf2cfaed6ac9410dafccac0d4f3a.tar.xz
Modify PUC Lua to wrap C++ exceptions (#12445)
Diffstat (limited to 'lib/lua/src/ldo.c')
-rw-r--r--lib/lua/src/ldo.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/lua/src/ldo.c b/lib/lua/src/ldo.c
index d1bf786cb..57d2ac7c2 100644
--- a/lib/lua/src/ldo.c
+++ b/lib/lua/src/ldo.c
@@ -317,7 +317,11 @@ int luaD_precall (lua_State *L, StkId func, int nresults) {
if (L->hookmask & LUA_MASKCALL)
luaD_callhook(L, LUA_HOOKCALL, -1);
lua_unlock(L);
- n = (*curr_func(L)->c.f)(L); /* do the actual call */
+ /* MINETEST-SPECIFIC CHANGE: Let custom code wrap C function calls. */
+ if (G(L)->wrapcf)
+ n = G(L)->wrapcf(L, *curr_func(L)->c.f);
+ else
+ n = (*curr_func(L)->c.f)(L);
lua_lock(L);
if (n < 0) /* yielding? */
return PCRYIELD;