crx string overflow warning

Message ID
State New
Headers show
  • 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


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)
 getregliststring (int mask, char *string, enum REG_ARG_TYPE core_cop)
-  char temp_string[5];
+  char temp_string[16];
   int i;
   string[0] = '{';