lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Given that we use lua_error for our abort semantics, and probably soon to be our commit, too, is there a good programming pattern that can be used to ensure that Lua cannot 'fake' one of these calls using error(?), forcing them to always go through our interface? Would a piece of user data on the stack prior to lua_error do the trick?

Most probably. But note that you'll need to be able to compare the Lua value
raised as an error with your special value, so perhaps it's best to store
that value in the registry.