diff options
Diffstat (limited to 'src/lj_api.c')
-rw-r--r-- | src/lj_api.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lj_api.c b/src/lj_api.c index 8216c395..48bd605d 100644 --- a/src/lj_api.c +++ b/src/lj_api.c | |||
@@ -1102,7 +1102,7 @@ static TValue *cpparser(lua_State *L, lua_CFunction dummy, void *ud) | |||
1102 | GCfunc *fn; | 1102 | GCfunc *fn; |
1103 | UNUSED(dummy); | 1103 | UNUSED(dummy); |
1104 | cframe_errfunc(L->cframe) = -1; /* Inherit error function. */ | 1104 | cframe_errfunc(L->cframe) = -1; /* Inherit error function. */ |
1105 | lj_lex_start(L, ls); | 1105 | lj_lex_setup(L, ls); |
1106 | fn = lj_func_newL(L, lj_parse(ls), tabref(L->env)); | 1106 | fn = lj_func_newL(L, lj_parse(ls), tabref(L->env)); |
1107 | /* Parser may realloc stack. Don't combine above/below into one statement. */ | 1107 | /* Parser may realloc stack. Don't combine above/below into one statement. */ |
1108 | setfuncV(L, L->top++, fn); | 1108 | setfuncV(L, L->top++, fn); |
@@ -1114,14 +1114,12 @@ LUA_API int lua_load(lua_State *L, lua_Reader reader, void *data, | |||
1114 | { | 1114 | { |
1115 | LexState ls; | 1115 | LexState ls; |
1116 | int status; | 1116 | int status; |
1117 | global_State *g; | ||
1118 | ls.rfunc = reader; | 1117 | ls.rfunc = reader; |
1119 | ls.rdata = data; | 1118 | ls.rdata = data; |
1120 | ls.chunkarg = chunkname ? chunkname : "?"; | 1119 | ls.chunkarg = chunkname ? chunkname : "?"; |
1121 | lj_str_initbuf(L, &ls.sb); | 1120 | lj_str_initbuf(L, &ls.sb); |
1122 | status = lj_vm_cpcall(L, NULL, &ls, cpparser); | 1121 | status = lj_vm_cpcall(L, NULL, &ls, cpparser); |
1123 | g = G(L); | 1122 | lj_lex_cleanup(L, &ls); |
1124 | lj_str_freebuf(g, &ls.sb); | ||
1125 | lj_gc_check(L); | 1123 | lj_gc_check(L); |
1126 | return status; | 1124 | return status; |
1127 | } | 1125 | } |