Types moved to jode.type

An array may be tUObject
don't check array type on store


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@601 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 84a9056e68
commit 9b8083c75c
  1. 13
      jode/jode/jvm/CodeVerifier.java

@ -1,9 +1,6 @@
package jode.jvm; package jode.jvm;
import jode.bytecode.*; import jode.bytecode.*;
import jode.Type; import jode.type.*;
import jode.MethodType;
import jode.ArrayType;
import jode.ClassInterfacesType;
import jode.AssertError; import jode.AssertError;
import jode.Decompiler; import jode.Decompiler;
import java.util.BitSet; import java.util.BitSet;
@ -361,7 +358,9 @@ public class CodeVerifier implements Opcodes {
|| !isOfType(arrType, Type.tArray(Type.tBoolean)))) || !isOfType(arrType, Type.tArray(Type.tBoolean))))
throw new VerifyException(instr.getDescription()); throw new VerifyException(instr.getDescription());
result.push(((ArrayType)arrType).getElementType()); Type elemType = (arrType == Type.tUObject ? Type.tUObject
:((ArrayType)arrType).getElementType());
result.push(elemType);
if (((1 << instr.opcode - opc_iaload) & 0xa) != 0) if (((1 << instr.opcode - opc_iaload) & 0xa) != 0)
result.push(Type.tVoid); result.push(Type.tVoid);
break; break;
@ -408,7 +407,9 @@ public class CodeVerifier implements Opcodes {
&& (instr.opcode != opc_bastore && (instr.opcode != opc_bastore
|| !isOfType(arrType, Type.tArray(Type.tBoolean)))) || !isOfType(arrType, Type.tArray(Type.tBoolean))))
throw new VerifyException(instr.getDescription()); throw new VerifyException(instr.getDescription());
if (!isOfType(type, ((ArrayType)arrType).getElementType())) Type elemType = instr.opcode >= opc_bastore ? Type.tInt
: types[instr.opcode - opc_iastore];
if (!isOfType(type, elemType))
throw new VerifyException(instr.getDescription()); throw new VerifyException(instr.getDescription());
break; break;
} }

Loading…
Cancel
Save