[jboss-jira] [JBoss JIRA] Resolved: (JASSIST-138) CHECKCAST of javassist.bytecode.analysis.Executor.execute() is broken

Shigeru Chiba (JIRA) jira-events at lists.jboss.org
Fri Jul 8 05:11:23 EDT 2011


     [ https://issues.jboss.org/browse/JASSIST-138?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shigeru Chiba resolved JASSIST-138.
-----------------------------------

    Fix Version/s: 3.15.0.GA
       Resolution: Done


> CHECKCAST of javassist.bytecode.analysis.Executor.execute() is broken
> ---------------------------------------------------------------------
>
>                 Key: JASSIST-138
>                 URL: https://issues.jboss.org/browse/JASSIST-138
>             Project: Javassist
>          Issue Type: Bug
>    Affects Versions: 3.12.0.GA
>            Reporter: Yu Kobayashi
>            Assignee: Shigeru Chiba
>             Fix For: 3.15.0.GA
>
>
> At execute(MethodInfo method, int pos, CodeIterator iter, Frame frame, Subroutine subroutine) of
> javassist.bytecode.analysis.Executor, CHECKCAST is this.
> case CHECKCAST:
>     verifyAssignable(Type.OBJECT, simplePop(frame));
>     frame.push(typeFromDesc(constPool.getClassInfo(iter.u16bitAt(pos + 1))));
>     break;
> However, constPool.getClassInfo() doesn't returns its descriptor.
> To fix this, please change it to 
> frame.push(typeFromDesc(constPool.getClassInfoByDescriptor(iter.u16bitAt(pos + 1))));
> and add this to javassist.bytecode.ConstPool.
>     public String getClassInfoByDescriptor(int index) {
>         ClassInfo c = (ClassInfo)getItem(index);
>         if (c == null)
>             return null;
>         else {
>         	String className = getUtf8Info(c.name);
>         	if (className.charAt(0) == '[') {
>         		return className;
>         	} else {
>             	return Descriptor.of(className);
>             }
>         }
>     }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list