changeset 6417:f619b069f2ca

Merge
author drchase
date Thu, 24 Jul 2014 18:46:55 +0000
parents 55fbdf0799ae f72d8917322a
children f0afba33c928
files
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/ci/ciField.cpp	Tue Mar 11 13:38:32 2014 -0400
+++ b/src/share/vm/ci/ciField.cpp	Thu Jul 24 18:46:55 2014 +0000
@@ -138,6 +138,17 @@
     return;
   }
 
+  // Access check based on declared_holder. canonical_holder should not be used
+  // to check access because it can erroneously succeed. If this check fails,
+  // propagate the declared holder to will_link() which in turn will bail out
+  // 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;
+    return;
+  }
+
   assert(canonical_holder == field_desc.field_holder(), "just checking");
   initialize_from(&field_desc);
 }