Skip to content

Commit 600efd6

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 346ff93 commit 600efd6

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
@@ -1028,13 +1028,6 @@ static size_t jl_static_show_x_(JL_STREAM *out, jl_value_t *v, jl_datatype_t *vt
10281028
else if (vt == jl_uint8_type) {
10291029
n += jl_printf(out, "0x%02" PRIx8, *(uint8_t*)v);
10301030
}
1031-
else if (jl_pointer_type && jl_is_cpointer_type((jl_value_t*)vt)) {
1032-
#ifdef _P64
1033-
n += jl_printf(out, "0x%016" PRIx64, *(uint64_t*)v);
1034-
#else
1035-
n += jl_printf(out, "0x%08" PRIx32, *(uint32_t*)v);
1036-
#endif
1037-
}
10381031
else if (vt == jl_float16_type) {
10391032
n += jl_static_show_float(out, julia_half_to_float(*(uint16_t *)v), vt);
10401033
}

test/show.jl

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

1533+
# Pointers should round-trip
1534+
Ptr{Cvoid}(0), Ptr{Cvoid}(typemax(UInt)), Ptr{Any}(0), Ptr{Any}(typemax(UInt)),
1535+
15331536
# :var"" escaping rules differ from strings (#58484)
15341537
:foo,
15351538
:var"bar baz",

0 commit comments

Comments
 (0)