⛏️ index : buildtools.git

author Alexander von Gluck IV <kallisti5@unixzen.com> 2012-04-14 12:12:58.0 -05:00:00
committer Alexander von Gluck IV <kallisti5@unixzen.com> 2012-04-14 12:14:37.0 -05:00:00
commit
2dc19755ccb92785ba27147115de85bfcc283eaa [patch]
tree
b4e20e694263bd3ea19effebef78e585e8a3b053
parent
cc75156e51a0824ebb1ff1af6f7d451f4377e4de
download
2dc19755ccb92785ba27147115de85bfcc283eaa.tar.gz

gcc: Avoid out-of-scope access of newv.

* Cherry-picked regression fix from gcc 4.6 mainline
* Simple 2 line change.
* GCC 4.7+ compiling gcc 4.6 would fail
* GCC bug 51969
* Fix was added to gcc 4.6-mainline via rev 184239
* Resolves #8470

Diff

 gcc/gcc/gengtype.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gcc/gcc/gengtype.c b/gcc/gcc/gengtype.c
index abf17f8..6c0ca4a 100644
--- a/gcc/gcc/gengtype.c
+++ a/gcc/gcc/gengtype.c
@@ -3594,14 +3594,13 @@
		  int has_length, struct fileloc *line, const char *if_marked,
		  bool emit_pch, type_p field_type, const char *field_name)
{
  struct pair newv;
  /* If the field reference is relative to V, rather than to some
     subcomponent of V, we can mark any subarrays with a single stride.
     We're effectively treating the field as a global variable in its
     own right.  */
  if (v && type == v->type)
    {
      struct pair newv;

      newv = *v;
      newv.type = field_type;
      newv.name = ACONCAT ((v->name, ".", field_name, NULL));