Commit 3bb0c8db by Dodji Seketeli Committed by Dodji Seketeli

Fix lookup of macro maps

	* line-map.c (linemap_macro_map_lookup): Fix logic.

From-SVN: r180427
parent 84756fd4
2011-10-24 Dodji Seketeli <dodji@redhat.com> 2011-10-24 Dodji Seketeli <dodji@redhat.com>
* line-map.c (linemap_macro_map_lookup): Fix logic.
2011-10-24 Dodji Seketeli <dodji@redhat.com>
* include/line-map.h (linemap_expand_location): Take a line table * include/line-map.h (linemap_expand_location): Take a line table
parameter. Update comment. parameter. Update comment.
(linemap_resolve_location): Update comment. (linemap_resolve_location): Update comment.
......
...@@ -588,14 +588,14 @@ linemap_macro_map_lookup (struct line_maps *set, source_location line) ...@@ -588,14 +588,14 @@ linemap_macro_map_lookup (struct line_maps *set, source_location line)
mn = 0; mn = 0;
} }
do while (mn < mx)
{ {
md = (mx + mn) / 2; md = (mx + mn) / 2;
if (MAP_START_LOCATION (LINEMAPS_MACRO_MAP_AT (set, md)) > line) if (MAP_START_LOCATION (LINEMAPS_MACRO_MAP_AT (set, md)) > line)
mn = md; mn = md + 1;
else else
mx = md; mx = md;
} while (mx - mn > 1); }
LINEMAPS_MACRO_CACHE (set) = mx; LINEMAPS_MACRO_CACHE (set) = mx;
result = LINEMAPS_MACRO_MAP_AT (set, LINEMAPS_MACRO_CACHE (set)); result = LINEMAPS_MACRO_MAP_AT (set, LINEMAPS_MACRO_CACHE (set));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment