Skip to content

Commit

Permalink
Fix segfault in static_show, by using correct vt instead of `typeof…
Browse files Browse the repository at this point in the history
…(v)`

This fixes a segfault introduced in JuliaLang#38049.

Co-Authored-By: Sacha Verweij <sacha.verweij@alumni.stanford.edu>
  • Loading branch information
NHDaly and Sacha0 committed Nov 11, 2020
1 parent e486c23 commit 8f54d34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rtutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ static size_t jl_static_show_x_(JL_STREAM *out, jl_value_t *v, jl_datatype_t *vt
n += jl_static_show_x(out, *(jl_value_t**)v, depth);
n += jl_printf(out, ")");
}
else if (jl_function_type && jl_isa(v, (jl_value_t*)jl_function_type)) {
else if (jl_function_type && jl_subtype(vt, (jl_value_t*)jl_function_type)) {
// v is function instance (an instance of a Function type).
jl_datatype_t *dv = (jl_datatype_t*)vt;
jl_sym_t *sym = dv->name->mt->name;
Expand Down

0 comments on commit 8f54d34

Please sign in to comment.