Patchwork [c-family] Minor tweak to -fdump-ada-spec

login
register
mail settings
Submitter Eric Botcazou
Date Aug. 9, 2013, 10:54 a.m.
Message ID <201308091254.23855.ebotcazou@adacore.com>
Download mbox | patch
Permalink /patch/265988/
State New
Headers show

Comments

Eric Botcazou - Aug. 9, 2013, 10:54 a.m.
This fixes a segfault on specific C++ code using <vector> when -fdump-ada-spec 
is passed to the compiler.

Tested on x86_64-suse-linux, applied on the mainline and 4.8 branch as obvious.


2013-08-09  Arnaud Charlet  <charlet@adacore.com>

	* c-ada-spec.c (print_ada_declaration): Prevent accessing null asm name

Patch

Index: c-ada-spec.c
===================================================================
--- c-ada-spec.c	(revision 201592)
+++ c-ada-spec.c	(working copy)
@@ -2900,7 +2900,7 @@  print_ada_declaration (pretty_printer *b
       pp_string (buffer, "  -- ");
       dump_sloc (buffer, t);
 
-      if (is_abstract)
+      if (is_abstract || !DECL_ASSEMBLER_NAME (t))
 	return 1;
 
       newline_and_indent (buffer, spc);