commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BCEL-189) Wrong field resolution in the verifier may lead to verification error
Date Sun, 08 Mar 2015 23:16:38 GMT

    [ https://issues.apache.org/jira/browse/BCEL-189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14352333#comment-14352333
] 

Sebb commented on BCEL-189:
---------------------------

+1

And ideally don't have any protected or public mutable fields; instead use getter/setter methods.

> Wrong field resolution in the verifier may lead to verification error
> ---------------------------------------------------------------------
>
>                 Key: BCEL-189
>                 URL: https://issues.apache.org/jira/browse/BCEL-189
>             Project: Commons BCEL
>          Issue Type: Bug
>          Components: Verifier
>    Affects Versions: 6.0
>            Reporter: Jérôme Leroux
>         Attachments: BCEL-189-2.patch, BCEL-189-2.zip, BCEL-189.patch, BCEL-189.zip
>
>
> The field reference resolution is not implemented correctly in the verifier. This may
lead to an unresolved field reference that fails the verification of a correct classfile.
> Here is a Java example that fails:
> {code:java}
> public class B extends A{
>     public void test(){
>         int i = this.field;
>     }
> }
> class A {
>     int field;
> }
> {code}
> See chapter _5.4.3.2 Field Resolution_ of the _The Java Virtual Machine Specification
Second Edition_ for more information (http://docs.oracle.com/javase/specs/jvms/se5.0/html/ConstantPool.doc.html#71685)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message