Skip to content

Commit fe613d4

Browse files
authored
fix trimming size regression due to handling binding backedges in the wrong place (#57927)
1 parent fcf492d commit fe613d4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/staticdata.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,6 @@ static void jl_queue_module_for_serialization(jl_serializer_state *s, jl_module_
798798
// ... or point to Base functions accessed by the runtime
799799
(m == jl_base_module && (!strcmp(jl_symbol_name(b->globalref->name), "wait") ||
800800
!strcmp(jl_symbol_name(b->globalref->name), "task_done_hook"))))) {
801-
record_field_change((jl_value_t**)&b->backedges, NULL);
802801
jl_queue_for_serialization(s, b);
803802
}
804803
}
@@ -1044,6 +1043,9 @@ static void jl_insert_into_serialization_queue(jl_serializer_state *s, jl_value_
10441043
record_field_change((jl_value_t **)&tn->mt, NULL);
10451044
}
10461045
}
1046+
else if (jl_is_binding(v)) {
1047+
record_field_change((jl_value_t**)&((jl_binding_t*)v)->backedges, NULL);
1048+
}
10471049
}
10481050
char *data = (char*)jl_data_ptr(v);
10491051
size_t i, np = layout->npointers;

test/trimming/trimming.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ let exe_suffix = splitext(Base.julia_exename())[2]
44

55
hello_exe = joinpath(@__DIR__, "hello" * exe_suffix)
66
@test readchomp(`$hello_exe`) == "Hello, world!"
7-
@test filesize(hello_exe) < 20_000_000
7+
@test filesize(hello_exe) < 2_000_000
88

99
basic_jll_exe = joinpath(@__DIR__, "basic_jll" * exe_suffix)
1010
lines = split(readchomp(`$basic_jll_exe`), "\n")

0 commit comments

Comments
 (0)