Skip to content
Permalink
Browse files
8260046: Assert left >= right in pointer_delta() methods
Reviewed-by: sjohanss, kbarrett, tschatzl
  • Loading branch information
albertnetymk committed May 14, 2021
1 parent 5eda812 commit 360928d16dbfd2e878694995a2f65ba5b5a1dbe6
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/hotspot/share/utilities/globalDefinitions.hpp
@@ -416,6 +416,7 @@ inline address_word castable_address(void* x) { return address_w
inline size_t pointer_delta(const volatile void* left,
const volatile void* right,
size_t element_size) {
assert(left >= right, "avoid underflow");
return (((uintptr_t) left) - ((uintptr_t) right)) / element_size;
}

0 comments on commit 360928d

Please sign in to comment.