* jode/jvm/CodeVerifier.java.in (doVerify): Don't check for

uninitialized objects in local or stack slots on backwards jump or
exception blocks.  Sun's jdk also doesn't check it, and I never
understood why it is necessary.  But see JVM Spec 4.9.4.


git-svn-id: https://svn.code.sf.net/p/jode/code/branches/branch_1_1@1314 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
hoenicke 24 years ago
parent 736e9595d2
commit 23adc4ce78
  1. 7
      jode/ChangeLog
  2. 21
      jode/jode/jvm/CodeVerifier.java.in

@ -1,3 +1,10 @@
2001-05-08 Jochen Hoenicke <jochen@gnu.org>
* jode/jvm/CodeVerifier.java.in (doVerify): Don't check for
uninitialized objects in local or stack slots on backwards jump or
exception blocks. Sun's jdk also doesn't check it, and I never
understood why it is necessary. But see JVM Spec 4.9.4.
2001-05-02 Jochen Hoenicke <jochen@gnu.org> 2001-05-02 Jochen Hoenicke <jochen@gnu.org>
* jode/obfuscator/modules/ConstantAnalyzer.java.in (handleOpcode): * jode/obfuscator/modules/ConstantAnalyzer.java.in (handleOpcode):

@ -1054,21 +1054,6 @@ public class CodeVerifier implements Opcodes {
} }
if (instr.getSuccs() != null) { if (instr.getSuccs() != null) {
for (int i=0; i< instr.getSuccs().length; i++) { for (int i=0; i< instr.getSuccs().length; i++) {
if (instr.getSuccs()[i].getAddr() < instr.getAddr()) {
/* This is a backwards branch */
for (int j = 0; j < prevInfo.locals.length; j++) {
if (prevInfo.locals[j]
.getTypeSig().charAt(0) == 'N')
throw new VerifyException
("Uninitialized local in back-branch");
}
for (int j = 0; j < prevInfo.stackHeight; j++) {
if (prevInfo.stack[j]
.getTypeSig().charAt(0) == 'N')
throw new VerifyException
("Uninitialized stack in back-branch");
}
}
if (mergeInfo(instr.getSuccs()[i], if (mergeInfo(instr.getSuccs()[i],
(VerifyInfo) info.clone())) (VerifyInfo) info.clone()))
todoSet.add(instr.getSuccs()[i]); todoSet.add(instr.getSuccs()[i]);
@ -1077,12 +1062,6 @@ public class CodeVerifier implements Opcodes {
for (int i=0; i<handlers.length; i++) { for (int i=0; i<handlers.length; i++) {
if (handlers[i].start.compareTo(instr) <= 0 if (handlers[i].start.compareTo(instr) <= 0
&& handlers[i].end.compareTo(instr) >= 0) { && handlers[i].end.compareTo(instr) >= 0) {
for (int j = 0; j < prevInfo.locals.length; j++) {
if (prevInfo.locals[j]
.getTypeSig().charAt(0) == 'N')
throw new VerifyException
("Uninitialized local in try block");
}
VerifyInfo excInfo = (VerifyInfo) prevInfo.clone(); VerifyInfo excInfo = (VerifyInfo) prevInfo.clone();
excInfo.stackHeight = 1; excInfo.stackHeight = 1;
if (handlers[i].type != null) if (handlers[i].type != null)

Loading…
Cancel
Save