Skip to content

Commit 36bd3ad

Browse files
authored
Make Ptr values static-show w/ type-information (#58584)
Small follow-up to #58512
1 parent f7d8a58 commit 36bd3ad

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/rtutils.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,13 +1065,6 @@ static size_t jl_static_show_x_(JL_STREAM *out, jl_value_t *v, jl_datatype_t *vt
10651065
else if (vt == jl_uint8_type) {
10661066
n += jl_printf(out, "0x%02" PRIx8, *(uint8_t*)v);
10671067
}
1068-
else if (jl_pointer_type && jl_is_cpointer_type((jl_value_t*)vt)) {
1069-
#ifdef _P64
1070-
n += jl_printf(out, "0x%016" PRIx64, *(uint64_t*)v);
1071-
#else
1072-
n += jl_printf(out, "0x%08" PRIx32, *(uint32_t*)v);
1073-
#endif
1074-
}
10751068
else if (vt == jl_float16_type) {
10761069
n += jl_static_show_float(out, julia_half_to_float(*(uint16_t *)v), vt);
10771070
}

test/show.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,6 +1595,9 @@ struct var"%X%" end # Invalid name without '#'
15951595
Float16(1e4), 1f8, 1e17,
15961596
Float16(-1e4), -1f8, -1e17,
15971597

1598+
# Pointers should round-trip
1599+
Ptr{Cvoid}(0), Ptr{Cvoid}(typemax(UInt)), Ptr{Any}(0), Ptr{Any}(typemax(UInt)),
1600+
15981601
# :var"" escaping rules differ from strings (#58484)
15991602
:foo,
16001603
:var"bar baz",

0 commit comments

Comments
 (0)