Skip to content

Commit

Permalink
Fix jl_static_show for bitstype
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
yuyichao committed Aug 4, 2016
1 parent 8973c7d commit bffa84e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,7 @@ static size_t jl_static_show_x_(JL_STREAM *out, jl_value_t *v, jl_datatype_t *vt
size_t nb = jl_datatype_size(vt);
size_t tlen = jl_datatype_nfields(vt);
if (nb > 0 && tlen == 0) {
char *data = (char*)jl_data_ptr(v);
uint8_t *data = (uint8_t*)v;
n += jl_printf(out, "0x");
for(int i=nb-1; i >= 0; --i)
n += jl_printf(out, "%02" PRIx8, data[i]);
Expand Down

0 comments on commit bffa84e

Please sign in to comment.