src/share/vm/runtime/reflection.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/runtime/reflection.cpp Fri Sep 2 08:39:29 2016
--- new/src/share/vm/runtime/reflection.cpp Fri Sep 2 08:39:27 2016
*** 410,426 ****
--- 410,426 ----
assert(result == result2, "results must be consistent");
#endif //ASSERT
return result;
}
! static bool under_host_klass(const InstanceKlass* ik, const InstanceKlass* host_klass) {
DEBUG_ONLY(int inf_loop_check = 1000 * 1000 * 1000);
for (;;) {
! const Klass* hc = (const Klass*)ik->host_klass();
! const InstanceKlass* hc = ik->host_klass();
if (hc == NULL) return false;
if (hc == host_klass) return true;
! ik = InstanceKlass::cast(hc);
// There's no way to make a host class loop short of patching memory.
// Therefore there cannot be a loop here unless there's another bug.
// Still, let's check for it.
assert(--inf_loop_check > 0, "no host_klass loop");
*** 434,445 ****
--- 434,445 ----
const InstanceKlass* accessor_ik = InstanceKlass::cast(accessor);
const InstanceKlass* accessee_ik = InstanceKlass::cast(accessee);
// If either is on the other's host_klass chain, access is OK,
// because one is inside the other.
! if (under_host_klass(accessor_ik, accessee_ik) ||
! under_host_klass(accessee_ik, accessor))
! under_host_klass(accessee_ik, accessor_ik))
return true;
if ((RelaxAccessControlCheck &&
accessor_ik->major_version() < Verifier::NO_RELAX_ACCESS_CTRL_CHECK_VERSION &&
accessee_ik->major_version() < Verifier::NO_RELAX_ACCESS_CTRL_CHECK_VERSION) ||
src/share/vm/runtime/reflection.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File