You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2019/07/07 00:06:00 UTC
[jira] [Comment Edited] (BCEL-291) Verifier rejects invokevirtual
on array: org.apache.bcel.generic.ClassGenException: [Ljava/lang/Object;
does not represent an ObjectType
[ https://issues.apache.org/jira/browse/BCEL-291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16879704#comment-16879704 ]
Gary Gregory edited comment on BCEL-291 at 7/7/19 12:05 AM:
------------------------------------------------------------
Added test {{org.apache.bcel.verifier.JiraBcel291TestCase}}.
was (Author: garydgregory):
This seems fixed in git master. Added test case.
> Verifier rejects invokevirtual on array: org.apache.bcel.generic.ClassGenException: [Ljava/lang/Object; does not represent an ObjectType
> ----------------------------------------------------------------------------------------------------------------------------------------
>
> Key: BCEL-291
> URL: https://issues.apache.org/jira/browse/BCEL-291
> Project: Commons BCEL
> Issue Type: Bug
> Affects Versions: 6.0
> Reporter: Peter Burka
> Priority: Major
> Fix For: 6.4.0
>
>
> If a Java program invokes a java.lang.Object method on a variable whose static type is an array, the methodref associated with the invokevirtual will refer to an array class.
> When the BCEL verifier encounters such a class, it fails with a ClassGenException.
> Test case:
> {noformat}
> public class Bug1 {
> public static Object[] bug(Object[] arg) {
> return arg.clone();
> }
> }
> {noformat}
> Outoput:
> {noformat}
> JustIce by Enver Haase, (C) 2001-2002.
> <http://bcel.sourceforge.net>
> <http://commons.apache.org/bcel>
> Now verifying: Bug1
> Pass 1:
> VERIFIED_OK
> Passed verification.
> Pass 2:
> VERIFIED_OK
> Passed verification.
> Pass 3a, method number 0 ['public void <init>()']:
> VERIFIED_OK
> Passed verification.
> Pass 3b, method number 0 ['public void <init>()']:
> VERIFIED_OK
> Passed verification.
> Exception in thread "main" org.apache.bcel.generic.ClassGenException: [Ljava/lang/Object; does not represent an ObjectType
> at org.apache.bcel.generic.FieldOrMethod.getLoadClassType(FieldOrMethod.java:137)
> at org.apache.bcel.verifier.statics.Pass3aVerifier$InstOperandConstraintVisitor.visitLoadClass(Pass3aVerifier.java:521)
> at org.apache.bcel.generic.INVOKEVIRTUAL.accept(INVOKEVIRTUAL.java:85)
> at org.apache.bcel.generic.InstructionHandle.accept(InstructionHandle.java:302)
> at org.apache.bcel.verifier.statics.Pass3aVerifier.pass3StaticInstructionOperandsChecks(Pass3aVerifier.java:443)
> at org.apache.bcel.verifier.statics.Pass3aVerifier.do_verify(Pass3aVerifier.java:208)
> at org.apache.bcel.verifier.PassVerifier.verify(PassVerifier.java:71)
> at org.apache.bcel.verifier.Verifier.doPass3a(Verifier.java:89)
> at org.apache.bcel.verifier.Verifier.main(Verifier.java:216)
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)