Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3933

SDK • Re: Panic function

$
0
0
In vanilla Lua 5.4.7, luaD_throw() in ldo.c does all the panicking, and it's a no return function. May be the only place panic is called. A lot of luaD_throw calls appear to be memory or stack related, so it's like a blue screen local to Lua unless the state/objects has been so messed up that memory has been corrupted. But generally, it's "all stop" for Lua.

For vanilla Lua, all state is in a lua_State struct, so the panic function is just something you can set after a lua_newstate() call I think. Then it is called mostly by luaD_throw via g->panic and so it doesn't touch the C SDK panic. You can point g->panic to any valid function/handler. I think a Lua panic "blue screen" is nice addition... :D

Statistics: Posted by katak255 — Tue Jan 14, 2025 3:54 am



Viewing all articles
Browse latest Browse all 3933

Trending Articles