diff options
author | Dodji Seketeli <dodji@redhat.com> | 2011-10-25 08:59:07 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2011-10-25 10:59:07 +0200 |
commit | 3bb0c8dbb0e99451b8520360310e62ce849df6ca (patch) | |
tree | 3118660fc98a44786e5afbba0b9d5f7fcb1aa5aa /libcpp/line-map.c | |
parent | 84756fd40adc5ceb732dccc84056e08d3ef0186d (diff) | |
download | gcc-3bb0c8dbb0e99451b8520360310e62ce849df6ca.zip gcc-3bb0c8dbb0e99451b8520360310e62ce849df6ca.tar.gz gcc-3bb0c8dbb0e99451b8520360310e62ce849df6ca.tar.bz2 |
Fix lookup of macro maps
* line-map.c (linemap_macro_map_lookup): Fix logic.
From-SVN: r180427
Diffstat (limited to 'libcpp/line-map.c')
-rw-r--r-- | libcpp/line-map.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libcpp/line-map.c b/libcpp/line-map.c index 7a1decc..23a0347 100644 --- a/libcpp/line-map.c +++ b/libcpp/line-map.c @@ -588,14 +588,14 @@ linemap_macro_map_lookup (struct line_maps *set, source_location line) mn = 0; } - do + while (mn < mx) { md = (mx + mn) / 2; if (MAP_START_LOCATION (LINEMAPS_MACRO_MAP_AT (set, md)) > line) - mn = md; + mn = md + 1; else mx = md; - } while (mx - mn > 1); + } LINEMAPS_MACRO_CACHE (set) = mx; result = LINEMAPS_MACRO_MAP_AT (set, LINEMAPS_MACRO_CACHE (set)); |