commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Roberts (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BCEL-283) Support for StackMap should be different from StackMapTable
Date Mon, 19 Dec 2016 16:27:58 GMT

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

Mark Roberts commented on BCEL-283:
-----------------------------------

I have changed my mind on this - we do not need to support - in fact, we should disallow.
 StackMaps are not needed for Java versions < JDK6 and the new style StackMapTable is required
for Java versions > JDK5.  So I made a small change to Attribute.java that warns and ignores
old style StackMaps.  This worked fine for the problems I had observed.

> Support for StackMap should be different from StackMapTable
> -----------------------------------------------------------
>
>                 Key: BCEL-283
>                 URL: https://issues.apache.org/jira/browse/BCEL-283
>             Project: Commons BCEL
>          Issue Type: Bug
>            Reporter: Mark Roberts
>         Attachments: Appendix1-verifier.pdf, ClassFileCMP-SE6.0.pdf
>
>
> It turns out we made a mistake with the StackMap renaming changes.  I ran into a problem
decoding some old .class files and went back to the Java Specification Requests (JSRs) to
try and understand the history of the StackMap attribute.  While I was not able to get the
complete story, I have a pretty good guess at what happened and it does explain the problem
I have seen.
> The official introduction of StackMaps appears to be JSR 202 from (approx.) Sept. 2006
and it is part of JDK6 (see attached spec) .   However, StackMaps were originally proposed
much earlier (approx.) March 2002 - see the attached verifier spec.  It appears there were
some implementations of this earlier specification - the ASM tool was one and there may be
others.  
> The key differences are: 
> Typechecker Spec:	StackMap attribute with fixed format and no frame type byte
> JDK 6 Spec:		StackMapTable attribute with variable format including a frame type byte.
> The JVM and the javap tool support BOTH formats.  BCEL recognizes both attribute names,
but treats them the same, as JDK6 version.
> I don't think the changes will be too difficult.  I will create a proposed fix within
the next few days.



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

Mime
View raw message