]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
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 325972faeb810c7e8174955783da04bb1213911a..0f47a20fdd047c43b9b8d1d3b638ccee0b4f956e 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 a70ab81aac4b08013d4199a13ea952f9308cadfb..27a2aa802891865c9b9f6dc1a1a19bb10f632b08 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] = '{';