Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/bfd Fixed an off-by-one bug when trying to look up ...



details:   https://anonhg.NetBSD.org/src/rev/b49029260192
branches:  trunk
changeset: 472171:b49029260192
user:      kristerw <kristerw%NetBSD.org@localhost>
date:      Fri Apr 23 21:34:53 1999 +0000

description:
Fixed an off-by-one bug when trying to look up a line given an address.
This could cause segmentation fault for ld when writing messages from
warning symbols.

diffstat:

 gnu/dist/bfd/ecofflink.c |  5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diffs (23 lines):

diff -r 23581bc6563d -r b49029260192 gnu/dist/bfd/ecofflink.c
--- a/gnu/dist/bfd/ecofflink.c  Fri Apr 23 19:29:30 1999 +0000
+++ b/gnu/dist/bfd/ecofflink.c  Fri Apr 23 21:34:53 1999 +0000
@@ -2085,7 +2085,6 @@
          pdr_ptr = ((char *) debug_info->external_pdr
                     + fdr_ptr->ipdFirst * external_pdr_size);
          pdr_end = pdr_ptr + fdr_ptr->cpd * external_pdr_size;
-         (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr);
          /* Find PDR that is closest to OFFSET.  If pdr.prof is set,
             the procedure entry-point *may* be 0x10 below pdr.adr.  We
             simply pretend that pdr.prof *implies* a lower entry-point.
@@ -2093,9 +2092,9 @@
             in front of the function as belonging to the function.  */
          for (pdr_hold = NULL;
               pdr_ptr < pdr_end;
-              (pdr_ptr += external_pdr_size,
-               (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr)))
+              pdr_ptr += external_pdr_size)
            {
+             (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr);
              if (offset >= (pdr.adr - 0x10 * pdr.prof))
                {
                  dist = offset - (pdr.adr - 0x10 * pdr.prof);



Home | Main Index | Thread Index | Old Index