This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Avoid a possible compiler bug by using a static buffer instead of a stack local buffer.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=63634bb4a107877dd08b6282e28e11cfd1a1649e

commit 63634bb4a107877dd08b6282e28e11cfd1a1649e
Author: Nick Clifton <nickc@redhat.com>
Date:   Thu Jun 15 12:44:23 2017 +0100

    Avoid a possible compiler bug by using a static buffer instead of a stack local buffer.
    
    	PR binutils/21582
    	* ieee.c (ieee_object_p): Use a static buffer to avoid compiler
    	bugs.

Diff:
---
 bfd/ChangeLog | 6 ++++++
 bfd/ieee.c    | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f39dd09..7cbd761 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
 2017-06-15  Nick Clifton  <nickc@redhat.com>
 
+	PR binutils/21582
+	* ieee.c (ieee_object_p): Use a static buffer to avoid compiler
+	bugs.
+
+2017-06-15  Nick Clifton  <nickc@redhat.com>
+
 	PR binutils/21579
 	* vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
 
diff --git a/bfd/ieee.c b/bfd/ieee.c
index 763c2b8..0884d87 100644
--- a/bfd/ieee.c
+++ b/bfd/ieee.c
@@ -1873,7 +1873,7 @@ ieee_object_p (bfd *abfd)
   char *processor;
   unsigned int part;
   ieee_data_type *ieee;
-  unsigned char buffer[300];
+  static unsigned char buffer[300];
   ieee_data_type *save = IEEE_DATA (abfd);
   bfd_size_type amt;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]