lua-users home
lua-l archive

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



Hi,

I noticed that the line that actually causes the crash is

luaC_checkgc()

which is a macro that calls luaC_collectgarbage() from time
to time. If I comment that line out, it does not crash any more.
But that does not really help me.

If it's not allowed to call lua_pushstring or lua_newtable etc.
during the parser is active, is there any other way to store data
in the registry during script parsing? 

Any help appreciated.

Greets

Andreas

On 04.06.2005 at 00:14 Andreas Falkenhahn wrote:

>Hi,
>
>I tried to store some data in the lua registry during script parsing. If I
>call
>
>switch(ls->t.token) {
>case TK_IF:
>....
>
>case TK_MY_OWN_TOKEN:
>lua_pushstring(ls->L, "hello world");
>lua_pop(ls->L, 1);
>}
>
>in lparser.c/statement(), my program usually crashes. So my question is:
>Is it allowed to use lua API functions like lua_pushstring, lua_newtable,
>lua_gettable etc. to store data in the registry while lua is in parsing
>mode?
>
>Or should those functions only be used in lua libraries?
>
>Greets
>
>Andreas  
>--
>"Remember: It's nice to be important but it's more important to be nice!"



--
"Remember: It's nice to be important but it's more important to be nice!"