ubsan: emit_inc_line_addr integer overflow

Alan Modra amodra@gmail.com
Fri May 16 12:19:03 GMT 2025


Commit 07cf922195d1 fixed the one in size_inc_line_addr.  Silly me
missed the identical overflow in emit_inc_line_addr

diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index a53ad1a150d..fd1f96d80c5 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -1694,7 +1694,7 @@ emit_inc_line_addr (int line_delta, addressT addr_delta, char *p, int len)
     }
 
   /* Bias the line delta by the base.  */
-  tmp = line_delta - DWARF2_LINE_BASE;
+  tmp = (unsigned) line_delta - DWARF2_LINE_BASE;
 
   /* If the line increment is out of range of a special opcode, we
      must encode it with DW_LNS_advance_line.  */

-- 
Alan Modra


More information about the Binutils mailing list