Skip to content

Commit 5d22e4e

Browse files
topolarityKristofferC
authored andcommitted
Make Ptr values static-show w/ type-information (#58584)
Small follow-up to #58512 (cherry picked from commit 36bd3ad)
1 parent a90ca9a commit 5d22e4e

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
@@ -1014,13 +1014,6 @@ static size_t jl_static_show_x_(JL_STREAM *out, jl_value_t *v, jl_datatype_t *vt
10141014
else if (vt == jl_uint8_type) {
10151015
n += jl_printf(out, "0x%02" PRIx8, *(uint8_t*)v);
10161016
}
1017-
else if (jl_pointer_type && jl_is_cpointer_type((jl_value_t*)vt)) {
1018-
#ifdef _P64
1019-
n += jl_printf(out, "0x%016" PRIx64, *(uint64_t*)v);
1020-
#else
1021-
n += jl_printf(out, "0x%08" PRIx32, *(uint32_t*)v);
1022-
#endif
1023-
}
10241017
else if (vt == jl_float16_type) {
10251018
n += jl_static_show_float(out, julia__gnu_h2f_ieee(*(uint16_t *)v), vt);
10261019
}

test/show.jl

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

1517+
# Pointers should round-trip
1518+
Ptr{Cvoid}(0), Ptr{Cvoid}(typemax(UInt)), Ptr{Any}(0), Ptr{Any}(typemax(UInt)),
1519+
15171520
# :var"" escaping rules differ from strings (#58484)
15181521
:foo,
15191522
:var"bar baz",

0 commit comments

Comments
 (0)