public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] bfd: Fix minor bug in read_indexed_address function.
@ 2022-08-27  4:59 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-08-27  4:59 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9c17922bfec7b9a0f6183b996cba5a9699f0da1a

commit 9c17922bfec7b9a0f6183b996cba5a9699f0da1a
Author: rupothar <rupesh.potharla@amd.com>
Date:   Fri Aug 26 23:13:06 2022 +0530

    bfd: Fix minor bug in read_indexed_address function.
    
    read_indexed_address function is using offset_size instead of
    addr_size while reading addrx forms.

Diff:
---
 bfd/dwarf2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 69d30216771..6e5d40b8241 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -1412,7 +1412,7 @@ read_indexed_address (uint64_t idx, struct comp_unit *unit)
 		     &file->dwarf_addr_buffer, &file->dwarf_addr_size))
     return 0;
 
-  if (_bfd_mul_overflow (idx, unit->offset_size, &offset))
+  if (_bfd_mul_overflow (idx, unit->addr_size, &offset))
     return 0;
 
   offset += unit->dwarf_addr_offset;
@@ -1423,9 +1423,9 @@ read_indexed_address (uint64_t idx, struct comp_unit *unit)
 
   info_ptr = file->dwarf_addr_buffer + offset;
 
-  if (unit->offset_size == 4)
+  if (unit->addr_size == 4)
     return bfd_get_32 (unit->abfd, info_ptr);
-  else if (unit->offset_size == 8)
+  else if (unit->addr_size == 8)
     return bfd_get_64 (unit->abfd, info_ptr);
   else
     return 0;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-27  4:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-27  4:59 [binutils-gdb] bfd: Fix minor bug in read_indexed_address function Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).