From 4788abdec79a937e51ad334b608fa1bd03713112 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 1 Feb 2023 09:49:07 +0000 Subject: [PATCH] Fix compilation of the assembler with sanitization enabled. * dwarf2dbg.c (emit_inc_line_addr): Use unsigned constants when checking addr_delta. --- gas/ChangeLog | 5 +++++ gas/dwarf2dbg.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 33fb721c7c4..ce07ce45f23 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2023-02-01 Nick Clifton + + * dwarf2dbg.c (emit_inc_line_addr): Use unsigned constants when + checking addr_delta. + 2023-01-20 Frederic Cambus * configure.tgt (arm-*-openbsd*): Add target. diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index b54050c6442..05f966256e4 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -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; -- 2.30.2