diff mbox

Fix PA buglet with sprintf formatting

Message ID f8cc0557-ef5b-2f46-9046-d176a7cfc5a9@redhat.com
State New
Headers show

Commit Message

Jeff Law Oct. 26, 2016, 3:25 p.m. UTC
If we have enough thunks we could potentially overwrite the output 
buffer in pa_asm_output_mi_thunk:

       ASM_GENERATE_INTERNAL_LABEL (label, "LTHN", current_thunk_number);

In reality we're unlikely to get enough thunks to cause a problem, but 
fixing this is easy by just increasing the size of the buffer.

Installed on the trunk.

Jeff
diff mbox

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c9b72bc..7d869b1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@ 
 2016-10-26  Jeff Law  <law@redhat.com>
 
+	* config/pa/pa.c (pa_asm_output_mi_thunk): Increase buffer
+	size.
+
 	* config/h8300/h8300.c (h8300_print_operand): Adjust FALLTHRU
 	comment to silence warning.
 
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index e04abd4..c8ce083 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -8345,7 +8345,7 @@  pa_asm_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta,
   static unsigned int current_thunk_number;
   int val_14 = VAL_14_BITS_P (delta);
   unsigned int old_last_address = last_address, nbytes = 0;
-  char label[16];
+  char label[17];
   rtx xoperands[4];
 
   xoperands[0] = XEXP (DECL_RTL (function), 0);