mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-19 21:43:27 +00:00
fix arg error
This commit is contained in:
parent
3e78833b0a
commit
32d892111d
@ -89,7 +89,7 @@ LUALIB_API void luaL_openlibs(lua_State *L)
|
|||||||
" end\n"
|
" end\n"
|
||||||
" return dump(f, strip)\n"
|
" return dump(f, strip)\n"
|
||||||
"end\n";
|
"end\n";
|
||||||
(luaL_loadstring(L, dump_fix) || lua_pcall(L, 0, 0, 0));
|
//(luaL_loadstring(L, dump_fix) || lua_pcall(L, 0, 0, 0));
|
||||||
#endif
|
#endif
|
||||||
#ifdef DO_LUA_INIT
|
#ifdef DO_LUA_INIT
|
||||||
handle_luainit(L);
|
handle_luainit(L);
|
||||||
|
@ -1133,7 +1133,7 @@ static MSize var_lookup_(FuncState *fs, GCstr *name, ExpDesc *e, int first)
|
|||||||
if ((int32_t)reg >= 0) { /* Local in this function? */
|
if ((int32_t)reg >= 0) { /* Local in this function? */
|
||||||
expr_init(e, VLOCAL, reg);
|
expr_init(e, VLOCAL, reg);
|
||||||
#if LUA_COMPAT_VARARG
|
#if LUA_COMPAT_VARARG
|
||||||
if (!fs->need_vararg && fs->flags & PROTO_VARARG){
|
if (!fs->need_vararg && fs->flags & PROTO_VARARG && reg == 0){
|
||||||
if (name->len == (sizeof("arg") - 1) && strncmp(strdata(name), "arg", name->len) == 0){
|
if (name->len == (sizeof("arg") - 1) && strncmp(strdata(name), "arg", name->len) == 0){
|
||||||
fs->need_vararg = 1;
|
fs->need_vararg = 1;
|
||||||
}
|
}
|
||||||
@ -2751,6 +2751,9 @@ static int parse_stmt(LexState *ls)
|
|||||||
|
|
||||||
static void add_argstmt(LexState* ls)
|
static void add_argstmt(LexState* ls)
|
||||||
{
|
{
|
||||||
|
//skip if/while/do-end body
|
||||||
|
if (ls->fs->bl->prev)
|
||||||
|
return;
|
||||||
ExpDesc e;
|
ExpDesc e;
|
||||||
|
|
||||||
if (ls->fs->flags & PROTO_VARARG) {
|
if (ls->fs->flags & PROTO_VARARG) {
|
||||||
|
Loading…
Reference in New Issue
Block a user