From 6c45f4a1221ca4d50afb565ec331d085bc50d35f Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 8 Oct 2012 23:04:54 +0200 Subject: [PATCH] Code cleanup. fde.c (binary_search_fde): Remove always true
= start> conditional. Move L initialization upwards. Signed-off-by: Jan Kratochvil --- libdw/ChangeLog | 6 ++++++ libdw/fde.c | 36 +++++++++++++++++------------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 416a16f1e..3500cf818 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,9 @@ +2012-10-08 Jan Kratochvil + + Code cleanup. + * fde.c (binary_search_fde): Remove always true
= start> + conditional. Move L initialization upwards. + 2012-08-24 Mark Wielaard * dwarf_begin_elf.c (check_section): Only probe for dwz multi files diff --git a/libdw/fde.c b/libdw/fde.c index d3667686f..bde0c9923 100644 --- a/libdw/fde.c +++ b/libdw/fde.c @@ -181,32 +181,30 @@ binary_search_fde (Dwarf_CFI *cache, Dwarf_Addr address) u = idx; else { + l = idx + 1; + Dwarf_Addr fde; if (unlikely (read_encoded_value (&dummy_cfi, cache->search_table_encoding, &p, &fde))) break; - if (address >= start) + + /* If this is the last entry, its upper bound is assumed to be + the end of the module. + XXX really should be end of containing PT_LOAD segment */ + if (l < cache->search_table_entries) { - l = idx + 1; - - /* If this is the last entry, its upper bound is assumed to be - the end of the module. - XXX really should be end of containing PT_LOAD segment */ - if (l < cache->search_table_entries) - { - /* Look at the start address in the following entry. */ - Dwarf_Addr end; - if (unlikely (read_encoded_value - (&dummy_cfi, cache->search_table_encoding, &p, - &end))) - break; - if (address >= end) - continue; - } - - return fde - cache->frame_vaddr; + /* Look at the start address in the following entry. */ + Dwarf_Addr end; + if (unlikely (read_encoded_value + (&dummy_cfi, cache->search_table_encoding, &p, + &end))) + break; + if (address >= end) + continue; } + + return fde - cache->frame_vaddr; } } -- 2.47.2