Skip to content

Commit 505789c

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 6e8340b commit 505789c

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
@@ -1062,13 +1062,6 @@ static size_t jl_static_show_x_(JL_STREAM *out, jl_value_t *v, jl_datatype_t *vt
10621062
else if (vt == jl_uint8_type) {
10631063
n += jl_printf(out, "0x%02" PRIx8, *(uint8_t*)v);
10641064
}
1065-
else if (jl_pointer_type && jl_is_cpointer_type((jl_value_t*)vt)) {
1066-
#ifdef _P64
1067-
n += jl_printf(out, "0x%016" PRIx64, *(uint64_t*)v);
1068-
#else
1069-
n += jl_printf(out, "0x%08" PRIx32, *(uint32_t*)v);
1070-
#endif
1071-
}
10721065
else if (vt == jl_float16_type) {
10731066
n += jl_static_show_float(out, julia_half_to_float(*(uint16_t *)v), vt);
10741067
}

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)