Skip to content

Commit

Permalink
Fixed RedefineClasses recursion when loading via JNI
Browse files Browse the repository at this point in the history
  • Loading branch information
apangin committed Nov 2, 2021
1 parent b80d163 commit 3e1e1c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vmEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ bool VM::init(JavaVM* vm, bool attach) {
callbacks.MonitorContendedEntered = LockTracer::MonitorContendedEntered;
_jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks));

_jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL);
_jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL);
_jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_CLASS_LOAD, NULL);
_jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_CLASS_PREPARE, NULL);
Expand All @@ -131,6 +130,8 @@ bool VM::init(JavaVM* vm, bool attach) {
DisableSweeper ds;
_jvmti->GenerateEvents(JVMTI_EVENT_DYNAMIC_CODE_GENERATED);
_jvmti->GenerateEvents(JVMTI_EVENT_COMPILED_METHOD_LOAD);
} else {
_jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL);
}

if (hotspot_version() > 0 && hotspot_version() < 11) {
Expand Down

0 comments on commit 3e1e1c6

Please sign in to comment.