fixes + dependency test

This commit is contained in:
ProgramSnail 2025-01-12 20:17:24 +03:00
parent 19c99bc7e5
commit 72ec1923e3
7 changed files with 46 additions and 17 deletions

View file

@ -52,7 +52,15 @@ Bytefile *read_file(const char *fname) {
}
long size = ftell(f);
long additional_size = sizeof(void *) * 5 + sizeof(int);
// [uint] stringtab_size
// [uint] global_area_size
// [uint] imports_number
// [uint] public_symbols_number
// char[0] buffer
long file_header_size = 4 * sizeof(uint) + sizeof(char[0]);
long additional_size = sizeof(Bytefile) - file_header_size;
file = (Bytefile *)malloc(size +
additional_size); // file itself + additional data