< prev index next >
src/hotspot/share/ci/ciField.cpp
Print this page
*** 166,175 ****
--- 166,183 ----
// compilation for this field access.
if (!Reflection::verify_field_access(klass->get_Klass(), declared_holder->get_Klass(), canonical_holder, field_desc.access_flags(), true)) {
_holder = declared_holder;
_offset = -1;
_is_constant = false;
+ // It's possible the access check failed due to a nestmate access check
+ // encountering an exception. We can't propagate the exception from here
+ // so we have to clear it. If the access check happens again in a different
+ // context then the exception will be thrown there.
+ Thread* THREAD = Thread::current();
+ if (HAS_PENDING_EXCEPTION) {
+ CLEAR_PENDING_EXCEPTION;
+ }
return;
}
assert(canonical_holder == field_desc.field_holder(), "just checking");
initialize_from(&field_desc);
< prev index next >