diff options
| -rw-r--r-- | tools/perf/util/hist.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 699cf81ea082..784ee0bdda77 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
| @@ -976,13 +976,17 @@ static int hist_entry__parse_objdump_line(struct hist_entry *self, FILE *file, | |||
| 976 | * Parse hexa addresses followed by ':' | 976 | * Parse hexa addresses followed by ':' |
| 977 | */ | 977 | */ |
| 978 | line_ip = strtoull(tmp, &tmp2, 16); | 978 | line_ip = strtoull(tmp, &tmp2, 16); |
| 979 | if (*tmp2 != ':' || tmp == tmp2) | 979 | if (*tmp2 != ':' || tmp == tmp2 || tmp2[1] == '\0') |
| 980 | line_ip = -1; | 980 | line_ip = -1; |
| 981 | } | 981 | } |
| 982 | 982 | ||
| 983 | if (line_ip != -1) { | 983 | if (line_ip != -1) { |
| 984 | u64 start = map__rip_2objdump(self->ms.map, sym->start); | 984 | u64 start = map__rip_2objdump(self->ms.map, sym->start), |
| 985 | end = map__rip_2objdump(self->ms.map, sym->end); | ||
| 986 | |||
| 985 | offset = line_ip - start; | 987 | offset = line_ip - start; |
| 988 | if (offset < 0 || (u64)line_ip > end) | ||
| 989 | offset = -1; | ||
| 986 | } | 990 | } |
| 987 | 991 | ||
| 988 | objdump_line = objdump_line__new(offset, line); | 992 | objdump_line = objdump_line__new(offset, line); |
