summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-21 23:10:07 +0000
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-21 23:10:07 +0000
commit21d1bacfc94e7ae56aa2cc2cfe89d9774157a1bb (patch)
treeaea85a214012f190cac88c6205ece96ed63dbdd9
parent5eb1a9023471d13018bda42df4c80cef90571895 (diff)
downloadppe42-gcc-21d1bacfc94e7ae56aa2cc2cfe89d9774157a1bb.tar.gz
ppe42-gcc-21d1bacfc94e7ae56aa2cc2cfe89d9774157a1bb.zip
* dwarf2out (output_file_names): Don't crash if called
with empty file_table. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61576 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/dwarf2out.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index de4c8f12d0e..0ff1f445616 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2003-01-21 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * dwarf2out (output_file_names): Don't crash if called
+ with empty file_table.
+
2003-01-21 Zack Weinberg <zack@codesourcery.com>
* genautomata.c (output_internal_insn_latency_func): Add
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 12e6fde24e3..4502a299b91 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -7289,6 +7289,14 @@ output_file_names ()
size_t i;
int idx;
+ /* Handle the case where file_table is empty. */
+ if (VARRAY_ACTIVE_SIZE (file_table) <= 1)
+ {
+ dw2_asm_output_data (1, 0, "End directory table");
+ dw2_asm_output_data (1, 0, "End file name table");
+ return;
+ }
+
/* Allocate the various arrays we need. */
files = (struct file_info *) alloca (VARRAY_ACTIVE_SIZE (file_table)
* sizeof (struct file_info));
OpenPOWER on IntegriCloud