[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Modifying field of local table via c-Api
- From: "Robert G. Jakabosky" <bobby@...>
- Date: Tue, 14 Jun 2011 05:33:17 -0700
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