lua-users home
lua-l archive

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


Hello, there

  

	     I was trying to use the lua auxiliar lib and I ran into an
access violation error on a lua macro.

  

	     My test was very simple, I just tried to call luaL_checkstring
using a valid index and then again with an invalid index.

  

	     My question is whether it was supposed to crash. Are the
function in the aux lib safe to be used without checking (stack size
checking, for example).

  

 Thanks,

  

 Thiago Ponte

  

  

  

 #include <lua.h>

 #include <lauxlib.h>

  

 void main()

 {

    lua_State * L = lua_open();

  

    lua_pushstring(L, "test1");

  

    printf("%s", luaL_checkstring(L, -1));

    printf("%s", luaL_checkstring(L, 5));

 }


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 7/6/2004