summaryrefslogtreecommitdiff
path: root/package.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-01-06 11:31:25 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-01-06 11:31:25 -0500
commitdef83bb2ae78f12c5c9588bd6cdc639b8aaaf27e (patch)
tree468e49339a44f57b528299a465c3843f5e2b38b0 /package.c
parentdc9cebe15132c5a15b3d0648285e9c86e40c14f6 (diff)
cleaning up; fixed a few bugs
Diffstat (limited to 'package.c')
-rw-r--r--package.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/package.c b/package.c
index 4763843..bef9a76 100644
--- a/package.c
+++ b/package.c
@@ -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);