]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf dwarf-aux: Use signed variable types in match_var_offset
authorZecheng Li <zecheng@google.com>
Mon, 25 Aug 2025 19:54:03 +0000 (19:54 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 3 Sep 2025 18:45:50 +0000 (15:45 -0300)
commit414bf79debdce9bb682b4f23f87ea97568afa67b
tree137c4589e164144edf7bc29ab16e6e35c229ff0c
parent9105df0185ea3a89e6651985e829897a8d3a94ae
perf dwarf-aux: Use signed variable types in match_var_offset

match_var_offset() compares address offsets to determine if an access
falls within a variable's bounds. The offsets involved for those
relative to base registers from DW_OP_breg can be negative.

The current implementation uses unsigned types (u64) for these offsets,
which rejects almost all negative values.

Change the signature of match_var_offset() to use signed types (s64).

This ensures correct behavior when addr_offset or addr_type are
negative.

Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Zecheng Li <zecheng@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Xu Liu <xliuprof@google.com>
Link: https://lore.kernel.org/r/20250825195412.223077-2-zecheng@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/dwarf-aux.c