Skip to content

Commit bffa84e

Browse files
committed
Fix jl_static_show for bitstype
The byte gets sign extended when passing to the vararg `jl_printf` and then printed as an unsigned int which might come with unwanted `0xff` prefix...
1 parent 8973c7d commit bffa84e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/builtins.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ static size_t jl_static_show_x_(JL_STREAM *out, jl_value_t *v, jl_datatype_t *vt
14791479
size_t nb = jl_datatype_size(vt);
14801480
size_t tlen = jl_datatype_nfields(vt);
14811481
if (nb > 0 && tlen == 0) {
1482-
char *data = (char*)jl_data_ptr(v);
1482+
uint8_t *data = (uint8_t*)v;
14831483
n += jl_printf(out, "0x");
14841484
for(int i=nb-1; i >= 0; --i)
14851485
n += jl_printf(out, "%02" PRIx8, data[i]);

0 commit comments

Comments
 (0)