aboutsummaryrefslogtreecommitdiff
path: root/gdb/stabsread.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1995-01-13 06:24:23 +0000
committerPer Bothner <per@bothner.com>1995-01-13 06:24:23 +0000
commit0f8631fbae3c35afea5ba16151d58d2504ce7b1f (patch)
tree811366a2b9ee7a463eaff3971a4b7b75cbf3248e /gdb/stabsread.c
parent203235652d1e75cf0c4f761807a8a2591ed767a3 (diff)
downloadgdb-0f8631fbae3c35afea5ba16151d58d2504ce7b1f.zip
gdb-0f8631fbae3c35afea5ba16151d58d2504ce7b1f.tar.gz
gdb-0f8631fbae3c35afea5ba16151d58d2504ce7b1f.tar.bz2
* stabsread.c (read_enum_type): When pending enum symbols are
put into the enum type, they must be inserted in "backwards order, in case we've overflowed a struct pending buffer.
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r--gdb/stabsread.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 8bc9948..ac334b2 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -3096,12 +3096,11 @@ read_enum_type (pp, type, objfile)
that in something like "enum {FOO, LAST_THING=FOO}" we print
FOO, not LAST_THING. */
- for (syms = *symlist, n = 0; syms; syms = syms->next)
+ for (syms = *symlist, n = nsyms - 1; ; syms = syms->next)
{
- int j = 0;
- if (syms == osyms)
- j = o_nsyms;
- for (; j < syms->nsyms; j++,n++)
+ int last = syms == osyms ? o_nsyms : 0;
+ int j = syms->nsyms;
+ for (; --j >= last; --n)
{
struct symbol *xsym = syms->symbol[j];
SYMBOL_TYPE (xsym) = type;