From 0f8631fbae3c35afea5ba16151d58d2504ce7b1f Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Fri, 13 Jan 1995 06:24:23 +0000 Subject: [PATCH] * 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. --- gdb/ChangeLog | 6 ++++++ gdb/stabsread.c | 9 ++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f10d7bc6839..4acad341966 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Thu Jan 12 21:23:25 1995 Per Bothner + + * 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. + Thu Jan 12 15:02:40 1995 Stu Grossman (grossman@cygnus.com) * gdbtk.c gdbtk.tcl: Update/add copyright. diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 8bc9948bea0..ac334b278f8 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; -- 2.30.2