MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / LoadHeader

Function LoadHeader

third-party/lua-5.2.4/src/lundump.c:190–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188#define N3 N2+6
189
190static void LoadHeader(LoadState* S)
191{
192 lu_byte h[LUAC_HEADERSIZE];
193 lu_byte s[LUAC_HEADERSIZE];
194 luaU_header(h);
195 memcpy(s,h,sizeof(char)); /* first char already read */
196 LoadBlock(S,s+sizeof(char),LUAC_HEADERSIZE-sizeof(char));
197 if (memcmp(h,s,N0)==0) return;
198 if (memcmp(h,s,N1)!=0) error(S,"not a");
199 if (memcmp(h,s,N2)!=0) error(S,"version mismatch in");
200 if (memcmp(h,s,N3)!=0) error(S,"incompatible"); else error(S,"corrupted");
201}
202
203/*
204** load precompiled chunk

Callers 1

luaU_undumpFunction · 0.70

Calls 3

luaU_headerFunction · 0.70
LoadBlockFunction · 0.70
errorFunction · 0.70

Tested by

no test coverage detected