lua-users home
lua-l archive

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


On 25 November 2011 18:14, Jimmie Hansson <jimmieh85@hotmail.com> wrote:
> Hi
>
> We have implemented lua on an embedded platform with a RTOS and have got
> everything to work except the if-else statement. When we execute a file we
> do that by reading the file into a string and then calling luaL_loadstring
> and after that lua_pcall(l,0,0,0). We do this because we haven’t fully
> ported memory reading yet.
>
> When we run an if else statement everything execute correctly until we reach
> the OP_EQ case in luaV_execute function in lvm.c. This only happens when the
> if statement is false. When the if statement is false we jump to a “random”
> case after the OP_EQ and this normally end in a fatal event or sometime just
> a” lua can’t run sting” We have tried the same lua code in windows
> environment and then everything works fine.
>
>
>
> Does anyone have any clue what’s going wrong in the OP_EQ case?
>
> We are in a bit of a tight schedule so a fast answer would be appreciated.
>
>
>
> Here is the lua code that crashes:
>
> a = 3
>
> if a==4 then
>
>                              b=3
>
> else
>
>                              b=5
>
> end

Have you compiled lua with apicheck on?

Otherwise this is very hard to look into without any sort of debug
log; test case or other data...