]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ubsan: emit_inc_line_addr integer overflow
authorAlan Modra <amodra@gmail.com>
Fri, 16 May 2025 09:04:31 +0000 (18:34 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 16 May 2025 11:16:42 +0000 (20:46 +0930)
Commit 07cf922195d1 fixed the one in size_inc_line_addr.  Silly me
missed the identical overflow in emit_inc_line_addr

gas/dwarf2dbg.c

index a53ad1a150d8e3b7720397b51a74eee9469d0c29..fd1f96d80c50efd0bb0f29d8beeb7d373752ee36 100644 (file)
@@ -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.  */