OK.
Jason
Jason Merrill writes:
> I think a better fix to your binary search algorithm would be to change
>
> mn = md;
>
> to be
>
> mn = md + 1;
>
> since you've eliminated md as a possibility. And then change the test to
>
> (mn < mx).
>
Right, thanks.
Here the updated patch, bootstrapped and te
On 10/21/2011 07:53 PM, Dodji Seketeli wrote:
- do
+ while (mx - mn> 1)
{
md = (mx + mn) / 2;
if (MAP_START_LOCATION (LINEMAPS_MACRO_MAP_AT (set, md))> line)
mn = md;
else
mx = md;
-} while (mx - mn> 1);
+}
+
+ /* There are cases where m
This is the right patch that I bootstrapped and tested.
* line-map.c (linemap_macro_map_lookup): Make sure to always pick
the map with the highest MAP_START_LOCATION.
---
libcpp/line-map.c |9 +++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/libcpp/line
Hello,
I noticed that linemap_macro_map_lookup can yield the wrong map when
at the end of the lookup, we end up with a pair of maps whose indexes
are (mn,mx) with mx-mn == 1. In that case, if the map we want is mn,
we'd wrongly yield mx.
Fixed thus, bootstrapped and tested on x86_64-unknown-linu