Skip to content

Commit

Permalink
8332473: ubsan: growableArray.hpp:290:10: runtime error: null pointer…
Browse files Browse the repository at this point in the history
… passed as argument 1, which is declared to never be null

Reviewed-by: jsjolen, clanger
  • Loading branch information
MBaesken committed May 21, 2024
1 parent 414a7fd commit e529101
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/hotspot/share/utilities/growableArray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,12 @@ class GrowableArrayView : public GrowableArrayBase {
}

void sort(int f(E*, E*)) {
if (_data == nullptr) return;
qsort(_data, length(), sizeof(E), (_sort_Fn)f);
}
// sort by fixed-stride sub arrays:
void sort(int f(E*, E*), int stride) {
if (_data == nullptr) return;
qsort(_data, length() / stride, sizeof(E) * stride, (_sort_Fn)f);
}

Expand Down

0 comments on commit e529101

Please sign in to comment.