Re: Trivial bug in bitop's bit.c: luaopen_bit()

  • From: "Thomas Harning Jr." <harningt@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Tue, 26 Feb 2013 21:14:07 -0500

On Tue, Feb 26, 2013 at 8:56 PM, Hadriel Kaplan <hadrielk@xxxxxxxxx> wrote:
>
> Sure, when called by Lua - but when bitop's embedded, and this func is
> called by other C-code to load it in some chain of loading libs, I would
> think the normal expectation is to get back the number of results pushed
> (ie, keep it balanced modulo the return value).
>
> As I said, not a big deal (it's "trivial") and your call... just noting it
> in case you didn't intend it.
>
> -hadriel
> p.s. thanks for bitop, BTW!
luaopen_* calls typically expect to be in an isolated environment, ex:
the standard Lua library registration expects to be called with their
own function environments.

A way to call this properly in an embedded environment would be to do
the following:

lua_push


--
Thomas Harning Jr. (http://about.me/harningt)

Other related posts: