diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-01-06 11:31:25 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-01-06 11:31:25 -0500 |
commit | def83bb2ae78f12c5c9588bd6cdc639b8aaaf27e (patch) | |
tree | 468e49339a44f57b528299a465c3843f5e2b38b0 /package.c | |
parent | dc9cebe15132c5a15b3d0648285e9c86e40c14f6 (diff) |
cleaning up; fixed a few bugs
Diffstat (limited to 'package.c')
-rw-r--r-- | package.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -107,7 +107,7 @@ static void exptr_start(Exporter *ex, const char *pkg_name, size_t pkg_name_len) export_u8(ex, toc[2]); export_u32(ex, TOP_FMT_VERSION); assert(ftell(ex->out) == 7L); - export_u32(ex, 0); /* placeholder for identifier offset in file */ + export_u64(ex, 0); /* placeholder for identifier offset in file */ export_len(ex, pkg_name_len); export_str(ex, pkg_name, pkg_name_len); bool has_code = code != NULL; @@ -559,11 +559,7 @@ static bool export_struct(Exporter *ex, StructDef *s) { static bool exptr_finish(Exporter *ex) { long ident_offset = ftell(ex->out); fseek(ex->out, 7L, SEEK_SET); - if (ident_offset > U32_MAX) { - err_print(LOCATION_NONE, "Package file is too large."); - return false; - } - export_u32(ex, (U32)ident_offset); + export_u64(ex, (U64)ident_offset); fseek(ex->out, 0L, SEEK_END); |