Re: [PATCH v1] perf annotate loongarch: Fix off-by-one bug in outside check

From: Arnaldo Carvalho de Melo

Date: Tue Mar 10 2026 - 11:12:12 EST


On Fri, Mar 06, 2026 at 10:53:06AM -0800, Ian Rogers wrote:
> A copy-paste of an issue fixed by Peter Collingbourne in:
> https://lore.kernel.org/linux-perf-users/20260304190613.2507582-1-pcc@xxxxxxxxxx/
>
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>

Thanks, applied to perf-tools, for v7.0.

- Arnaldo

> ---
> tools/perf/util/annotate-arch/annotate-loongarch.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/annotate-arch/annotate-loongarch.c b/tools/perf/util/annotate-arch/annotate-loongarch.c
> index 3aeab453a059..950f34e59e5c 100644
> --- a/tools/perf/util/annotate-arch/annotate-loongarch.c
> +++ b/tools/perf/util/annotate-arch/annotate-loongarch.c
> @@ -93,7 +93,7 @@ static int loongarch_jump__parse(const struct arch *arch, struct ins_operands *o
> start = map__unmap_ip(map, sym->start);
> end = map__unmap_ip(map, sym->end);
>
> - ops->target.outside = target.addr < start || target.addr > end;
> + ops->target.outside = target.addr < start || target.addr >= end;
>
> if (maps__find_ams(thread__maps(ms->thread), &target) == 0 &&
> map__rip_2objdump(target.ms.map, map__map_ip(target.ms.map, target.addr)) == ops->target.addr)
> --
> 2.53.0.473.g4a7958ca14-goog