diff options
Diffstat (limited to 'gcc/tree-pretty-print.cc')
-rw-r--r-- | gcc/tree-pretty-print.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-pretty-print.cc b/gcc/tree-pretty-print.cc index 12c57c1..58705c5 100644 --- a/gcc/tree-pretty-print.cc +++ b/gcc/tree-pretty-print.cc @@ -2248,10 +2248,11 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags, pp_minus (pp); val = -val; } - unsigned int prec = val.get_precision (); - if ((prec + 3) / 4 > sizeof (pp_buffer (pp)->digit_buffer) - 3) + unsigned int len; + print_hex_buf_size (val, &len); + if (UNLIKELY (len > sizeof (pp_buffer (pp)->digit_buffer))) { - char *buf = XALLOCAVEC (char, (prec + 3) / 4 + 3); + char *buf = XALLOCAVEC (char, len); print_hex (val, buf); pp_string (pp, buf); } |