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: