From 075db18fcfec511c32fc63006e31f7db20d186e8 Mon Sep 17 00:00:00 2001 From: hoenicke Date: Thu, 7 Sep 2000 16:10:44 +0000 Subject: [PATCH] Accept class version 46.0 (jdk1.2) git-svn-id: https://svn.code.sf.net/p/jode/code/branches/branch_1_1@1261 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/bytecode/ClassInfo.java.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jode/jode/bytecode/ClassInfo.java.in b/jode/jode/bytecode/ClassInfo.java.in index abb5a01..83f6533 100644 --- a/jode/jode/bytecode/ClassInfo.java.in +++ b/jode/jode/bytecode/ClassInfo.java.in @@ -272,10 +272,11 @@ public class ClassInfo extends BinaryInfo { /* header */ if (input.readInt() != 0xcafebabe) throw new ClassFormatException("Wrong magic"); - if (input.readUnsignedShort() > 3) - throw new ClassFormatException("Wrong minor"); - if (input.readUnsignedShort() != 45) - throw new ClassFormatException("Wrong major"); + int version = input.readUnsignedShort(); + version |= input.readUnsignedShort() << 16; + if (version < (45 << 16 | 0) + || version > (46 << 16 | 0)) + throw new ClassFormatException("Wrong class version"); /* constant pool */ ConstantPool cpool = new ConstantPool();