aboutsummaryrefslogtreecommitdiff
path: root/binutils/dwarf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-12-08 09:49:49 +0000
committerNick Clifton <nickc@redhat.com>2015-12-08 09:49:49 +0000
commit7460c0abe8a195243110e66624da095a44cc96d6 (patch)
tree717f6ef598061e8e893faf94526eaca0094b1f62 /binutils/dwarf.c
parentec9ab52c3217835113f22431911fda3474598fcd (diff)
downloadgdb-7460c0abe8a195243110e66624da095a44cc96d6.zip
gdb-7460c0abe8a195243110e66624da095a44cc96d6.tar.gz
gdb-7460c0abe8a195243110e66624da095a44cc96d6.tar.bz2
Fix static analysis warning about undefined bheaviour.
PR binutils/19310 * dwarf.c (display_debug_frames): Recode range test to avoid undefined behaviour.
Diffstat (limited to 'binutils/dwarf.c')
-rw-r--r--binutils/dwarf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 03e0117..0f6818f 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -6459,7 +6459,7 @@ display_debug_frames (struct dwarf_section *section,
case DW_CFA_def_cfa_expression:
ul = LEB ();
- if (start >= block_end || start + ul > block_end || start + ul < start)
+ if (start >= block_end || ul > (unsigned long) (block_end - start))
{
printf (_(" DW_CFA_def_cfa_expression: <corrupt len %lu>\n"), ul);
break;