Merge pull request #3101 from myk002/myk_no_binary_lua

remove lua's ability to load binary chunks
develop
Myk 2023-03-25 16:42:23 -07:00 committed by GitHub
commit 428f7572b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

@ -767,14 +767,14 @@ static void f_parser (lua_State *L, void *ud) {
LClosure *cl; LClosure *cl;
struct SParser *p = cast(struct SParser *, ud); struct SParser *p = cast(struct SParser *, ud);
int c = zgetc(p->z); /* read first character */ int c = zgetc(p->z); /* read first character */
if (c == LUA_SIGNATURE[0]) { // if (c == LUA_SIGNATURE[0]) {
checkmode(L, p->mode, "binary"); // checkmode(L, p->mode, "binary");
cl = luaU_undump(L, p->z, p->name); // cl = luaU_undump(L, p->z, p->name);
} // }
else { // else {
checkmode(L, p->mode, "text"); checkmode(L, p->mode, "text");
cl = luaY_parser(L, p->z, &p->buff, &p->dyd, p->name, c); cl = luaY_parser(L, p->z, &p->buff, &p->dyd, p->name, c);
} // }
lua_assert(cl->nupvalues == cl->p->sizeupvalues); lua_assert(cl->nupvalues == cl->p->sizeupvalues);
luaF_initupvals(L, cl); luaF_initupvals(L, cl);
} }