8351967: JFR: AnnotationIterator should handle num_annotations = 0

Reviewed-by: egahlin
This commit is contained in:
Markus Grönlund 2025-03-17 09:56:10 +00:00
parent c8913d2c9c
commit 2eecf159af

View File

@ -338,7 +338,7 @@ class AnnotationIterator : public StackObj {
_buffer(_limit > 2 ? ar->adr_at(2) : nullptr),
_current(0),
_next(0) {
if (_buffer != nullptr) {
if (_limit >= 2) {
_limit -= 2; // subtract sizeof(u2) number of annotations field
}
}