8221833: Readability check in Symbol::is_valid not performed for some addresses
Reviewed-by: zgu, coleenp
--- a/src/hotspot/share/runtime/os.cpp Fri Apr 05 09:06:19 2019 +0200
+++ b/src/hotspot/share/runtime/os.cpp Fri Apr 05 09:18:18 2019 +0200
@@ -1024,8 +1024,9 @@
}
bool os::is_readable_range(const void* from, const void* to) {
- for (address p = align_down((address)from, min_page_size()); p < to; p += min_page_size()) {
- if (!is_readable_pointer(p)) {
+ if ((uintptr_t)from >= (uintptr_t)to) return false;
+ for (uintptr_t p = align_down((uintptr_t)from, min_page_size()); p < (uintptr_t)to; p += min_page_size()) {
+ if (!is_readable_pointer((const void*)p)) {
return false;
}
}