The following example cause crash instead of failures
err = jvmti->GetFrameLocation(thr, 0, &mid, &loc);
if (err != JVMTI_ERROR_NONE) {
printf("(GetFrameLocation) unexpected error: %s (%d)\n",
TranslateError(err), err);
result = STATUS_FAILED;
}
The "mid" and "loc" shouldn't be used if GetFrameLocation failed.
Immediate return from the function is needed if it failed with non-JVMTI_ERROR_NONE.
err = jvmti->GetFrameLocation(thr, 0, &mid, &loc);
if (err != JVMTI_ERROR_NONE) {
printf("(GetFrameLocation) unexpected error: %s (%d)\n",
TranslateError(err), err);
result = STATUS_FAILED;
}
The "mid" and "loc" shouldn't be used if GetFrameLocation failed.
Immediate return from the function is needed if it failed with non-JVMTI_ERROR_NONE.