crx string overflow warning

Message ID 20180226001726.GQ3812@bubble.grove.modra.org
State New
Headers show
Series
  • crx string overflow warning
Related show

Commit Message

Alan Modra Feb. 26, 2018, 12:17 a.m.
gcc8 complains wrongly about the buffer not being large enough, at
least at -Og optimization.

	* crx-dis.c (getregliststring): Allocate a large enough buffer
	to silence false positive gcc8 warning.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/opcodes/crx-dis.c b/opcodes/crx-dis.c
index a70ab81..27a2aa8 100644
--- a/opcodes/crx-dis.c
+++ b/opcodes/crx-dis.c
@@ -244,7 +244,7 @@  powerof2 (int x)
 void
 getregliststring (int mask, char *string, enum REG_ARG_TYPE core_cop)
 {
-  char temp_string[5];
+  char temp_string[16];
   int i;
 
   string[0] = '{';