Open NanXiao opened 9 years ago
Hi Shark,
I am reading the main function in core/shark.c, and have some confusions:
Line 320 ~ 332
{ if((ret = luaL_loadfile(ls, argv[script]))) { ret = lua_report(ls, ret); goto out; } base = lua_gettop(ls) - 1; lua_pushcfunction(ls, lua_traceback); lua_insert(ls, base); if (lua_pcall(ls, 0, 0, base)) { fprintf(stderr, "%s\n", lua_tostring(ls, -1)); exit(EXIT_FAILURE); }
}
Before executing "lua_pcall(ls, 0, 0, base)", the Lua stack is like this:
script (-1) Last parameter (-2) lua_traceback (-3) penultimate parameter (-4)
So the "lua_pcall(ls, 0, 0, base)" can't process any parameters, right?
If you have time. please check whether it is right, thanks!
Best Regards Nan Xiao
Hi Shark,
I am reading the main function in core/shark.c, and have some confusions:
Line 320 ~ 332
}
Before executing "lua_pcall(ls, 0, 0, base)", the Lua stack is like this:
So the "lua_pcall(ls, 0, 0, base)" can't process any parameters, right?
If you have time. please check whether it is right, thanks!
Best Regards Nan Xiao