From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10461 invoked by alias); 20 Mar 2014 14:53:17 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 10442 invoked by uid 89); 20 Mar 2014 14:53:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.98.1 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com From: Tom Tromey To: jit@gcc.gnu.org Cc: gcc-patches@gcc.gnu.org, Tom Tromey Subject: [RFA jit] initialize input_location Date: Wed, 01 Jan 2014 00:00:00 -0000 Message-Id: <1395327187-14524-1-git-send-email-tromey@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-SW-Source: 2014-q1/txt/msg00094.txt.bz2 This patch initializes input_location at the same spot where the line table is initialized. Without this, it's possible to crash when emitting a diagnostic in a reinvocation of the compiler, because input_location refers to a location that is no longer valid. --- gcc/ChangeLog.jit | 4 ++++ gcc/toplev.c | 1 + 2 files changed, 5 insertions(+) diff --git a/gcc/ChangeLog.jit b/gcc/ChangeLog.jit index ee1df88..a9b0817 100644 --- a/gcc/ChangeLog.jit +++ b/gcc/ChangeLog.jit @@ -1,5 +1,9 @@ 2014-03-19 Tom Tromey + * toplev.c (general_init): Initialize input_location. + +2014-03-19 Tom Tromey + * timevar.h (auto_timevar): New class. 2014-03-19 Tom Tromey diff --git a/gcc/toplev.c b/gcc/toplev.c index b257ab2..1febc2e 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1161,6 +1161,7 @@ general_init (const char *argv0) table. */ init_ggc (); init_stringpool (); + input_location = 0; line_table = ggc_alloc_line_maps (); linemap_init (line_table); line_table->reallocator = realloc_for_line_map; -- 1.8.5.3