summaryrefslogtreecommitdiff
path: root/libcpp/line-map.c
diff options
context:
space:
mode:
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-25 08:59:07 +0000
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-25 08:59:07 +0000
commit68928989e30e64ffb748ddf6ac6fdbdfcb34e172 (patch)
tree3118660fc98a44786e5afbba0b9d5f7fcb1aa5aa /libcpp/line-map.c
parent5ebe21437f1bd988a9887289d6f33db552a83b89 (diff)
downloadgcc-68928989e30e64ffb748ddf6ac6fdbdfcb34e172.tar.gz
Fix lookup of macro maps
* line-map.c (linemap_macro_map_lookup): Fix logic. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180427 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/line-map.c')
-rw-r--r--libcpp/line-map.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index 7a1decc7501..23a0347cb5f 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));