MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / checkHeader

Function checkHeader

extlibs/lua/src/lundump.c:276–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274#define checksize(S,t) fchecksize(S,sizeof(t),#t)
275
276static void checkHeader (LoadState *S) {
277 /* skip 1st char (already read and checked) */
278 checkliteral(S, &LUA_SIGNATURE[1], "not a binary chunk");
279 if (loadInt(S) != LUAC_VERSION)
280 error(S, "version mismatch");
281 if (loadByte(S) != LUAC_FORMAT)
282 error(S, "format mismatch");
283 checkliteral(S, LUAC_DATA, "corrupted chunk");
284 checksize(S, Instruction);
285 checksize(S, lua_Integer);
286 checksize(S, lua_Number);
287 if (loadInteger(S) != LUAC_INT)
288 error(S, "integer format mismatch");
289 if (loadNumber(S) != LUAC_NUM)
290 error(S, "float format mismatch");
291}
292
293
294/*

Callers 1

luaU_undumpFunction · 0.85

Calls 6

checkliteralFunction · 0.85
loadIntFunction · 0.85
loadByteFunction · 0.85
loadIntegerFunction · 0.85
loadNumberFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected