Skip to content

Commit 8a5a120

Browse files
committed
[BOLT][Wrapper] Fix off-by-one in find_section upper limit
find_section used to match offsets equal to file_offset + size causing offsets to sometimes be attributed to the wrong section. Reviewed By: Amir Differential Revision: https://reviews.llvm.org/D149047
1 parent 4054c68 commit 8a5a120

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bolt/utils/llvm-bolt-wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def find_section(offset, readelf_hdr):
246246
file_offset = int(cols[5], 16)
247247
# section size
248248
size = int(cols[2], 16)
249-
if offset >= file_offset and offset <= file_offset + size:
249+
if offset >= file_offset and offset < file_offset + size:
250250
if sys.stdout.isatty(): # terminal supports colors
251251
print(f"\033[1m{line}\033[0m")
252252
else:

0 commit comments

Comments
 (0)