[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Can lua_next() error?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 16 Apr 2018 13:04:52 -0300
> On Mon, Apr 16, 2018 at 2:22 PM, Tom Sutcliffe <tomsci@me.com> wrote:
>
> > I've been reviewing some of my native code for safety and noticed that
> I've been assuming lua_next() will not raise arbitrary errors.
>
> Not only can it raise an error, it can also crash.
>
> http://lua-users.org/lists/lua-l/2017-12/msg00057.html
Practically all functions in the Lua-C API can crash, when called with
invalid arguments. It would be expensive, and often impossible, to check
for that kind of errors. (I believe this happens with most C libraries.)
-- Roberto