Add access check slow paths to field accesses
This check makes the verifier, compiler and runtime agree with who
should perform access checks and fixes compliance for these
instructions.
Introduce new "fast" sget/sput that just get the static storage base
from a method's declaring class when the static field is within the same
class. Saves a load and branch in the common case.
Fold gen routines for wide and not wide together.
Fix bug where sub-classes could appear intialized in the image but their
parents were only verified.
Extra debug output for test case 075.
Change-Id: I934da3624ed8fa8e026b2c95d936d04b1af022ef
diff --git a/test/075-verification-error/src/Main.java b/test/075-verification-error/src/Main.java
index 51d648c..9b66a8d 100644
--- a/test/075-verification-error/src/Main.java
+++ b/test/075-verification-error/src/Main.java
@@ -88,7 +88,7 @@
try {
int x = mutant.inaccessibleField;
- System.err.println("ERROR: bad access succeeded\n");
+ System.err.println("ERROR: bad access succeeded (ifield)");
} catch (IllegalAccessError iae) {
System.out.println("Got expected IllegalAccessError (ifield)");
if (VERBOSE) System.out.println("--- " + iae);
@@ -96,7 +96,7 @@
try {
int y = Mutant.inaccessibleStaticField;
- System.err.println("ERROR: bad access succeeded\n");
+ System.err.println("ERROR: bad access succeeded (sfield)");
} catch (IllegalAccessError iae) {
System.out.println("Got expected IllegalAccessError (sfield)");
if (VERBOSE) System.out.println("--- " + iae);
@@ -104,7 +104,7 @@
try {
mutant.inaccessibleMethod();
- System.err.println("ERROR: bad access succeeded\n");
+ System.err.println("ERROR: bad access succeeded (method)");
} catch (IllegalAccessError iae) {
System.out.println("Got expected IllegalAccessError (method)");
if (VERBOSE) System.out.println("--- " + iae);
@@ -112,7 +112,7 @@
try {
Mutant.inaccessibleStaticMethod();
- System.err.println("ERROR: bad access succeeded\n");
+ System.err.println("ERROR: bad access succeeded (smethod)");
} catch (IllegalAccessError iae) {
System.out.println("Got expected IllegalAccessError (smethod)");
if (VERBOSE) System.out.println("--- " + iae);
@@ -121,7 +121,7 @@
try {
/* accessible static method in an inaccessible class */
InaccessibleClass.test();
- System.err.println("ERROR: bad meth-class access succeeded\n");
+ System.err.println("ERROR: bad meth-class access succeeded (meth-class)");
} catch (IllegalAccessError iae) {
System.out.println("Got expected IllegalAccessError (meth-class)");
if (VERBOSE) System.out.println("--- " + iae);
@@ -130,7 +130,7 @@
try {
/* accessible static field in an inaccessible class */
int blah = InaccessibleClass.blah;
- System.err.println("ERROR: bad field-class access succeeded\n");
+ System.err.println("ERROR: bad field-class access succeeded (field-class)");
} catch (IllegalAccessError iae) {
System.out.println("Got expected IllegalAccessError (field-class)");
if (VERBOSE) System.out.println("--- " + iae);
@@ -139,7 +139,7 @@
try {
/* inaccessible static method in an accessible class */
InaccessibleMethod.test();
- System.err.println("ERROR: bad access succeeded\n");
+ System.err.println("ERROR: bad access succeeded (meth-meth)");
} catch (IllegalAccessError iae) {
System.out.println("Got expected IllegalAccessError (meth-meth)");
if (VERBOSE) System.out.println("--- " + iae);