Fix compilation of the assembler with sanitization enabled.
authorNick Clifton <nickc@redhat.com>
Wed, 1 Feb 2023 09:49:07 +0000 (09:49 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 1 Feb 2023 09:49:07 +0000 (09:49 +0000)
  * dwarf2dbg.c (emit_inc_line_addr): Use unsigned constants when checking addr_delta.

gas/ChangeLog
gas/dwarf2dbg.c

index 33fb721c7c4f94959deef517afadc90632dd7e16..ce07ce45f239e7800cde7faab7adbc261f0d278d 100644 (file)
@@ -1,3 +1,8 @@
+2023-02-01  Nick Clifton  <nickc@redhat.com>
+
+       * dwarf2dbg.c (emit_inc_line_addr): Use unsigned constants when
+       checking addr_delta.
+
 2023-01-20  Frederic Cambus  <fred@statdns.com>
 
        * configure.tgt (arm-*-openbsd*): Add target.
index b54050c644238b12eae03e3fd762fc85c4323c24..05f966256e4a6ba6d6c6cdd6917bf76e283357fd 100644 (file)
@@ -1641,7 +1641,7 @@ size_inc_line_addr (int line_delta, addressT addr_delta)
   tmp += DWARF2_LINE_OPCODE_BASE;
 
   /* Avoid overflow when addr_delta is large.  */
-  if (addr_delta < 256 + MAX_SPECIAL_ADDR_DELTA)
+  if (addr_delta < 256U + MAX_SPECIAL_ADDR_DELTA)
     {
       /* Try using a special opcode.  */
       opcode = tmp + addr_delta * DWARF2_LINE_RANGE;
@@ -1723,7 +1723,7 @@ emit_inc_line_addr (int line_delta, addressT addr_delta, char *p, int len)
   tmp += DWARF2_LINE_OPCODE_BASE;
 
   /* Avoid overflow when addr_delta is large.  */
-  if (addr_delta < 256 + MAX_SPECIAL_ADDR_DELTA)
+  if (addr_delta < 256U + MAX_SPECIAL_ADDR_DELTA)
     {
       /* Try using a special opcode.  */
       opcode = tmp + addr_delta * DWARF2_LINE_RANGE;