lua-users home
lua-l archive

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


On Monday 13, Jörg Walter wrote:
>   Here is my approach for modifying local table1.entry1:
> 
> lua_getlocal(ls, &debug_info, targetIndex);
> lua_getfield(ls, -1, "entry1");
> lua_pushstring(ls, "newVal");

replace this:
> lua_setfield(ls, -2, "entry1"); // CRASH
with this:
> lua_setfield(ls, -3, "entry1"); // CRASH
note the index ----^


-- 
Robert G. Jakabosky