| 188 | #define N3 N2+6 |
| 189 | |
| 190 | static 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 |
no test coverage detected