Skip to content

Commit dbe2575

Browse files
authored
don't strip keyword argument names with --strip-metadata (#234)
1 parent 494de59 commit dbe2575

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/staticdata.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2204,8 +2204,19 @@ static jl_value_t *strip_codeinfo_meta(jl_method_t *m, jl_value_t *ci_, int orig
22042204
jl_array_ptr_set(ci->slotnames, i, questionsym);
22052205
}
22062206
if (orig) {
2207-
m->slot_syms = jl_compress_argnames(ci->slotnames);
2207+
jl_array_t *slotnames = jl_uncompress_argnames(m->slot_syms);
2208+
JL_GC_PUSH1(&slotnames);
2209+
int tostrip = jl_array_len(slotnames);
2210+
if (jl_tparam0(jl_unwrap_unionall(m->sig)) == jl_typeof(jl_kwcall_func))
2211+
tostrip = m->nargs;
2212+
for (i = 0; i < tostrip; i++) {
2213+
jl_value_t *s = jl_array_ptr_ref(slotnames, i);
2214+
if (s != (jl_value_t*)jl_unused_sym)
2215+
jl_array_ptr_set(ci->slotnames, i, questionsym);
2216+
}
2217+
m->slot_syms = jl_compress_argnames(slotnames);
22082218
jl_gc_wb(m, m->slot_syms);
2219+
JL_GC_POP();
22092220
}
22102221
jl_value_t *ret = (jl_value_t*)ci;
22112222
if (compressed)

0 commit comments

Comments
 (0)