From: Tom Tromey <tromey@redhat.com>
To: jit@gcc.gnu.org
Cc: gcc-patches@gcc.gnu.org, Tom Tromey <tromey@redhat.com>
Subject: [RFA jit] initialize input_location
Date: Wed, 01 Jan 2014 00:00:00 -0000 [thread overview]
Message-ID: <1395327187-14524-1-git-send-email-tromey@redhat.com> (raw)
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 <tromey@redhat.com>
+ * toplev.c (general_init): Initialize input_location.
+
+2014-03-19 Tom Tromey <tromey@redhat.com>
+
* timevar.h (auto_timevar): New class.
2014-03-19 Tom Tromey <tromey@redhat.com>
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
next reply other threads:[~2014-03-20 14:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-01 0:00 Tom Tromey [this message]
2014-01-01 0:00 ` David Malcolm
2014-01-01 0:00 ` Tom Tromey
2014-01-01 0:00 ` David Malcolm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1395327187-14524-1-git-send-email-tromey@redhat.com \
--to=tromey@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jit@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).