Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/staticdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ done by `get_item_for_reloc`.
#include <stdlib.h>
#include <string.h>
#include <stdio.h> // printf
#include <inttypes.h> // PRIxPTR

#include "julia.h"
#include "julia_internal.h"
Expand Down Expand Up @@ -1947,9 +1948,22 @@ static void jl_save_system_image_to_stream(ios_t *f) JL_GC_DISABLED
jl_write_gv_tagrefs(&s);
}

if (sysimg.size > ((uintptr_t)1 << RELOC_TAG_OFFSET) ||
const_data.size > ((uintptr_t)1 << RELOC_TAG_OFFSET)*sizeof(void*)) {
jl_printf(JL_STDERR, "ERROR: system image too large\n");
if (sysimg.size > ((uintptr_t)1 << RELOC_TAG_OFFSET)) {
jl_printf(
JL_STDERR,
"ERROR: system image too large: sysimg.size is %jd but the limit is %" PRIxPTR "\n",
(intmax_t)sysimg.size,
((uintptr_t)1 << RELOC_TAG_OFFSET)
);
jl_exit(1);
}
if (const_data.size > ((uintptr_t)1 << RELOC_TAG_OFFSET)*sizeof(void*)) {
jl_printf(
JL_STDERR,
"ERROR: system image too large: const_data.size is %jd but the limit is %" PRIxPTR "\n",
(intmax_t)const_data.size,
((uintptr_t)1 << RELOC_TAG_OFFSET)*sizeof(void*)
);
jl_exit(1);
}

Expand Down