From b61c3a578b95325f25e08f41c6dfa199b3b53e0b Mon Sep 17 00:00:00 2001 From: jakub Date: Tue, 14 Feb 2012 23:31:42 +0000 Subject: Fix compilation with GCC 4.7 See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51969 PR bootstrap/51969 Backported from mainline 2011-11-08 Michael Matz * gengtype.c (write_field_root): Avoid out-of-scope access of newv. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@184239 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc-4.6/gcc/gengtype.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc-4.6/gcc/gengtype.c b/gcc-4.6/gcc/gengtype.c index abf17f8e7..6c0ca4a0b 100644 --- a/gcc-4.6/gcc/gengtype.c +++ b/gcc-4.6/gcc/gengtype.c @@ -3594,14 +3594,13 @@ write_field_root (outf_p f, pair_p v, type_p type, const char *name, 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)); -- cgit v1.2.3