commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary D. Gregory (Jira)" <j...@apache.org>
Subject [jira] [Updated] (BCEL-291) Verifier rejects invokevirtual on array: org.apache.bcel.generic.ClassGenException: [Ljava/lang/Object; does not represent an ObjectType
Date Thu, 03 Oct 2019 13:29:01 GMT

     [ https://issues.apache.org/jira/browse/BCEL-291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Gary D. Gregory updated BCEL-291:
---------------------------------
    Fix Version/s:     (was: 6.4.1)
                   6.4.2

> 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.2
>
>
> 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
(v8.3.4#803005)

Mime
View raw message