[JBoss JIRA] (JASSIST-145) erroneous "bad array type for AALOAD: null" when verifying
by Shigeru Chiba (JIRA)
[ https://issues.jboss.org/browse/JASSIST-145?page=com.atlassian.jira.plugi... ]
Shigeru Chiba closed JASSIST-145.
---------------------------------
> erroneous "bad array type for AALOAD: null" when verifying
> ----------------------------------------------------------
>
> Key: JASSIST-145
> URL: https://issues.jboss.org/browse/JASSIST-145
> Project: Javassist
> Issue Type: Bug
> Affects Versions: 3.15.0-GA
> Reporter: Shigeru Chiba
> Assignee: Shigeru Chiba
> Fix For: 3.16.0-GA
>
>
> (reported by Johannes Schindelin)
> When verifying bytecode compiled for Java 1.6+ where we need to provide a
> StackMapTable attribute which we verify ourselves first, the sequence
> ACONST_NULL
> ASTORE_0
> ...
> ALOAD_0
> ICONST_0
> AALOAD
> triggers the verifier to add NullType as an equivalent type for the
> ArrayType. Since that code might be unreachable after instrumenting or the
> local variable might have been set otherwise before jumping back to this
> code, we really need ArrayType's isNullType() method to report the correct
> result.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 4 months
[JBoss JIRA] (JASSIST-146) ClassFile.compact mangles large class files
by Shigeru Chiba (JIRA)
[ https://issues.jboss.org/browse/JASSIST-146?page=com.atlassian.jira.plugi... ]
Shigeru Chiba closed JASSIST-146.
---------------------------------
> ClassFile.compact mangles large class files
> -------------------------------------------
>
> Key: JASSIST-146
> URL: https://issues.jboss.org/browse/JASSIST-146
> Project: Javassist
> Issue Type: Bug
> Affects Versions: 3.15.0-GA
> Environment: Fedora Linux 14 x86_64, Java 1.6.0_27
> Reporter: Paul Rupe
> Assignee: Shigeru Chiba
> Fix For: 3.16.0-GA
>
>
> I have a large .class file (1307829 bytes). Simply reading it in using javassist, calling ClassFile.compact(), then writing it out to a new file creates an invalid class file that is substantially larger (1996560 bytes).
> javap -c throws an EOFException:
> java.io.EOFException
> at java.io.DataInputStream.readFully(DataInputStream.java:197)
> at java.io.DataInputStream.readFully(DataInputStream.java:169)
> at sun.tools.javap.AttrData.read(AttrData.java:54)
> at sun.tools.javap.FieldData.read(FieldData.java:91)
> at sun.tools.javap.ClassData.readFields(ClassData.java:211)
> at sun.tools.javap.ClassData.read(ClassData.java:114)
> at sun.tools.javap.ClassData.<init>(ClassData.java:70)
> at sun.tools.javap.JavapPrinter.<init>(JavapPrinter.java:48)
> at sun.tools.javap.Main.displayResults(Main.java:208)
> at sun.tools.javap.Main.perform(Main.java:79)
> at sun.tools.javap.Main.entry(Main.java:67)
> at sun.tools.javap.Main.main(Main.java:52)
> javassist throws an exception trying to read back the class file it just created:
> java.lang.ClassCastException: javassist.bytecode.FieldrefInfo cannot be cast to javassist.bytecode.Utf8Info
> at javassist.bytecode.ConstPool.getUtf8Info(ConstPool.java:615)
> at javassist.bytecode.AttributeInfo.read(AttributeInfo.java:76)
> at javassist.bytecode.FieldInfo.read(FieldInfo.java:253)
> at javassist.bytecode.FieldInfo.<init>(FieldInfo.java:63)
> at javassist.bytecode.ClassFile.read(ClassFile.java:783)
> at javassist.bytecode.ClassFile.<init>(ClassFile.java:109)
> at Test.compact(Test.java:21)
> at Test.main(Test.java:12)
> Attempting to use the new class file in an application results in
> java.lang.ClassFormatError: Invalid this class index 537 in constant pool in class file WorldGenCreateGuild
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 4 months
[JBoss JIRA] (JASSIST-39) failure to compile an instance method which invokes a static method in a different class and both methods have the same return type, name and argument types
by Shigeru Chiba (JIRA)
[ https://issues.jboss.org/browse/JASSIST-39?page=com.atlassian.jira.plugin... ]
Shigeru Chiba closed JASSIST-39.
--------------------------------
> failure to compile an instance method which invokes a static method in a different class and both methods have the same return type, name and argument types
> ------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: JASSIST-39
> URL: https://issues.jboss.org/browse/JASSIST-39
> Project: Javassist
> Issue Type: Bug
> Reporter: twieger
> Assignee: Shigeru Chiba
> Fix For: 3.13.0.GA
>
>
> The testcase below demonstrates the problem.
> The first invocation of CtNewMethod#make works, the second one fails.
> It looks like the problem is related with MemberResolver#lookupMethod.
> The check to enable the creation of a recursively called method is not precise enough. It actually succeeds, although the current method is an instance method, and the method which shall be invoked is a static method.
> ==========================================
> package experimental;
> import javassist.CannotCompileException;
> import javassist.ClassPool;
> import javassist.CtClass;
> import javassist.CtNewMethod;
> import org.testng.annotations.Test;
> public class TestJavaAssist {
> @Test
> public void testJavaAssist() throws CannotCompileException {
> ClassPool classPool = new ClassPool();
> classPool.appendSystemPath();
>
> CtClass ctClass = classPool.makeClass("Test");
> CtNewMethod.make("public String foox(){return experimental.TestJavaAssist.foo();}", ctClass);
> CtNewMethod.make("public String foo(){return experimental.TestJavaAssist.foo();}", ctClass);
> }
> public static final String foo() {
> return "foo";
> }
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 4 months
[JBoss JIRA] (JASSIST-182) update ClassFileWriter for Java 7 invokedynamic
by Shigeru Chiba (JIRA)
[ https://issues.jboss.org/browse/JASSIST-182?page=com.atlassian.jira.plugi... ]
Shigeru Chiba closed JASSIST-182.
---------------------------------
> update ClassFileWriter for Java 7 invokedynamic
> -----------------------------------------------
>
> Key: JASSIST-182
> URL: https://issues.jboss.org/browse/JASSIST-182
> Project: Javassist
> Issue Type: Feature Request
> Affects Versions: 3.17.0-GA
> Reporter: Shigeru Chiba
> Assignee: Shigeru Chiba
> Priority: Minor
> Fix For: 3.17.1-GA
>
> Attachments: classfilewriter.patch
>
>
> (Originally reported by Grigori Goronzy)
> With Javassist 3.17, the ClassFile, ConstPool, etc. classes gained support for the invokedynamic JVM opcode and associated constant pool data. However, ClassFileWriter wasn't updated, and it isn't possible, for instance, to add an InvokeDynamic_info with a ConstPoolWriter.
> The attached patch fixes this in the most straight-forward manner. I haven't tested it well, but the code is so simple that it is unlikely to have any bugs.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 4 months