Skip to content

Commit 6674771

Browse files
committed
8357468: [asan] heap buffer overflow reported in PcDesc::pc_offset() pcDesc.hpp:57
Reviewed-by: kvn, thartmann
1 parent 236e1b6 commit 6674771

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/hotspot/share/code/nmethod.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,9 @@ static inline bool match_desc(PcDesc* pc, int pc_offset, bool approximate) {
393393
if (!approximate) {
394394
return pc->pc_offset() == pc_offset;
395395
} else {
396-
return (pc-1)->pc_offset() < pc_offset && pc_offset <= pc->pc_offset();
396+
// Do not look before the sentinel
397+
assert(pc_offset > PcDesc::lower_offset_limit, "illegal pc_offset");
398+
return pc_offset <= pc->pc_offset() && (pc-1)->pc_offset() < pc_offset;
397399
}
398400
}
399401

0 commit comments

Comments
 (0)