i try to integrate Lua in a embedded project using GCC on a Cortex-M4. i am able to load and run a Lua script, calling Lua functions from C, calling C functions from Lua. but the C program crashes (HardFault\_Handler trap rises) when the given script passed as parameter in luaL\_dostring() contains any Lua syntax errors. 

here the relevant C code that crashes due to the syntax error in Lua:

```
      //create Lua VM...
      luaVm = lua_newstate(luaAlloc, NULL);

      //load libraries...
      luaopen_base(luaVm);
      luaopen_math(luaVm);
      luaopen_table(luaVm);
      luaopen_string(luaVm);

      //launch script...
      luaL_dostring(luaVm,  "function onTick()\n"
                            "  locaal x = 7\n"  //syntax error
                            "end\n"
                            "\n" );

```

when doing the same with correct Lua syntax, then it works:

```
  luaL_dostring(luaVm,  "function onTick()\n"
                        "  local x = 7\n"  
                        "end\n"
                        "\n" );

```

when debugging and stepping through luaL\_dostring(), i can follow the Lua parsing line for line, and when reaching the line with the syntax error, then the C program crashes. 

can anybody help? thanks.

---

have disabled `setjmp/longjmp` in Lua source code in the following way: 

```
//#define LUAI_THROW(L,c)    longjmp((c)->b, 1) //TODO oli4 orig
//#define LUAI_TRY(L,c,a)    if (setjmp((c)->b) == 0) { a } //TODO oli4 orig

#define LUAI_THROW(L,c)    while(1) //TODO oli4 special
#define LUAI_TRY(L,c,a)    { a }    //TODO oli4 special

```

...so there is no setjmp/longjmp used anymore, but i still have the crash :-(

must have another cause???