lua-users home
lua-l archive

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


Maybe you #ifdeffed out/accidentally removed the terminating { NULL, NULL } entry?

- Daan

Scales, Neil wrote:
Linit.c is modified, but only to #ifdef out modules we don't use.

static const luaL_Reg lualibs[] = {
  {"", luaopen_base},
#ifndef LUA_NOLOADLIB
  {LUA_LOADLIBNAME, luaopen_package},
Etc
#endif


luaopen_base still there as the first library and that is where the
problem is.

LUALIB_API void luaL_openlibs (lua_State *L) {
  const luaL_Reg *lib = lualibs;
  for (; lib->func; lib++) {
    lua_pushcfunction(L, lib->func);
    lua_pushstring(L, lib->name);	<----- * this is the problem
    lua_call(L, 1, 0);
  }
}


The first time round the loop is effectively lua_pushstring(L, "");
which calls:
	lua_pushlstring(L, "", 0);
which eventually calls:
	luaS_newlst(L, "", 0);

Which fails in the for loop I originally mentioned.



-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Luiz Henrique
de Figueiredo
Sent: 02 February 2010 16:56
To: Lua list
Subject: Re: Initialisation Issue

I'm not calling them directly, I was just showing parts of the call
stack.

Oh, ok. If you have modified linit.c, show it to us.
This e-mail and any files transmitted with it ("E-mail") is intended solely for the addressee(s)
and may contain confidential and/or legally privileged information. If you are not the addressee(s), any
disclosure, reproduction, copying, distribution or other use of the E-mail is prohibited. If you have received
this E-mail in error, please delete it and notify the sender immediately via our switchboard or return e-mail.

Neither the company nor any subsidiary or affiliate or associated company nor any individual sending this E-mail
accepts any liability in respect of the content (including errors and omissions) nor shall this e-mail be deemed
to enter the company or any subsidiary or affiliate or associated company into a contract or to create any
legally binding obligations unless expressly agreed to in writing under separate cover and timeliness of the
E-mail which arise as a result of transmission. If verification is required, please request a hard copy version
from the sender.