crx string overflow warning
authorAlan Modra <amodra@gmail.com>
Sat, 24 Feb 2018 00:03:33 +0000 (10:33 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 26 Feb 2018 00:21:12 +0000 (10:51 +1030)
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.

opcodes/ChangeLog
opcodes/crx-dis.c

index 325972f..0f47a20 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-26  Alan Modra  <amodra@gmail.com>
+
+       * crx-dis.c (getregliststring): Allocate a large enough buffer
+       to silence false positive gcc8 warning.
+
 2018-02-22  Shea Levy <shea@shealevy.com>
 
        * disassemble.c (ARCH_riscv): Define if ARCH_all.
index a70ab81..27a2aa8 100644 (file)
@@ -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] = '{';