Skip to content

Commit fa203ab

Browse files
authored
Fix VMMethod::validatedId() crash (#453)
1 parent 239da4c commit fa203ab

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ddprof-lib/src/main/cpp/hotspot/vmStructs.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,8 @@ jmethodID VMMethod::id() {
733733

734734
jmethodID VMMethod::validatedId() {
735735
jmethodID method_id = id();
736-
if (!_can_dereference_jmethod_id || (goodPtr(method_id) && *(VMMethod**)method_id == this)) {
736+
if (!_can_dereference_jmethod_id ||
737+
((goodPtr(method_id) && SafeAccess::loadPtr((void**)method_id, nullptr) == this))) {
737738
return method_id;
738739
}
739740
return NULL;

0 commit comments

Comments
 (0)