8011896: Add check for invalid offset for new AccessControlContext isAuthorized field
authormullan
Mon, 22 Apr 2013 08:33:12 -0400
changeset 18057 3c2ec1be67c7
parent 18056 0e99ee964114
child 18058 aef3e3b4b391
8011896: Add check for invalid offset for new AccessControlContext isAuthorized field Reviewed-by: acorn
hotspot/src/share/vm/classfile/javaClasses.cpp
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Fri Apr 05 10:18:36 2013 -0400
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Mon Apr 22 08:33:12 2013 -0400
@@ -2819,8 +2819,10 @@
   result->obj_field_put(_context_offset, context());
   result->obj_field_put(_privilegedContext_offset, privileged_context());
   result->bool_field_put(_isPrivileged_offset, isPrivileged);
-  // whitelist AccessControlContexts created by the JVM.
-  result->bool_field_put(_isAuthorized_offset, true);
+  // whitelist AccessControlContexts created by the JVM if present
+  if (_isAuthorized_offset != -1) {
+    result->bool_field_put(_isAuthorized_offset, true);
+  }
   return result;
 }