[COMMITTED] libdw: Don't dereference and assign values we are skipping

Message ID 20221103131800.18217-1-mark@klomp.org
State Committed
Headers
Series [COMMITTED] libdw: Don't dereference and assign values we are skipping |

Commit Message

Mark Wielaard Nov. 3, 2022, 1:18 p.m. UTC
  We don't use the FDE address encoding byte, so no reason
to read and store it. Just skip past it.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 libdw/ChangeLog        | 5 +++++
 libdw/dwarf_next_cfi.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
  

Patch

diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 3c595a3d..6cbf192d 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,8 @@ 
+2022-11-03  Mark Wielaard  <mark@klomp.org>
+
+	* dwarf_next_cfi.c (dwarf_next_cfi): Don't dereference and assign
+	bytes.
+
 2022-10-21  Yonggang Luo  <luoyonggang@gmail.com>
 
 	* dwarf_begin_elf.h: Don't include unistd.h and endian.h.
diff --git a/libdw/dwarf_next_cfi.c b/libdw/dwarf_next_cfi.c
index 23b16885..be08984f 100644
--- a/libdw/dwarf_next_cfi.c
+++ b/libdw/dwarf_next_cfi.c
@@ -226,7 +226,7 @@  dwarf_next_cfi (const unsigned char e_ident[],
 	      if (sized_augmentation)
 		{
 		  /* Skip FDE address encoding byte.  */
-		  encoding = *bytes++;
+		  bytes++;
 		  continue;
 		}
 	      break;