Re: Re: Handling of NULL at LocalVariablesSorter.visitFrame()
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <1519753370.1893101282575429092.JavaMail.root@zimbra7-e1.priv.proxad.net> |
it seems to be a bug in ASM 3.3. Can you try with the following patch?
Index: LocalVariablesSorter.java
===================================================================
--- LocalVariablesSorter.java (revision 1434)
+++ LocalVariablesSorter.java (working copy)
@@ -181,7 +181,7 @@
Object t = local[number];
int size = t == Opcodes.LONG || t == Opcodes.DOUBLE ? 2 : 1;
if (t != Opcodes.TOP) {
- Type typ;
+ Type typ = OBJECT_TYPE;
if (t == Opcodes.INTEGER) {
typ = Type.INT_TYPE;
} else if (t == Opcodes.FLOAT) {
@@ -190,7 +190,7 @@
typ = Type.LONG_TYPE;
} else if (t == Opcodes.DOUBLE) {
typ = Type.DOUBLE_TYPE;
- } else {
+ } else if (t instanceof String) {
typ = Type.getObjectType((String) t);
}
setFrameLocal(remap(index, typ), t);
Eric
----- Mail Original -----
De: "Eugene Kuleshov" <[email protected]>
À: [email protected]
Envoyé: Lundi 23 Août 2010 16h46:59 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
Objet: [asm] Re: Handling of NULL at LocalVariablesSorter.visitFrame()
Alexander,
Could you please open a bun in ASM issue tracker and attach a simple
test case that would allow to reproduce it?
Thanks
Eugene
On Mon, Aug 23, 2010 at 7:36 AM, <[email protected]> wrote:
> Hello,
>
> in version 3.3 the method LocalVariablesSorter.visitFrame() was updated to
> include the check of locals types. It checks for Integer, Float, Long, Double
> and otherwise use the following:
> typ = Type.getObjectType((String) t);
>
> I have the problem with this statement. If local value is Opcodes.NULL then
> we have ClassCastException (java.lang.Integer cannot be cast to
> java.lang.String).
> Probably the reason is that I use LocalVariablesSorter delegating to
> AnalyzerAdapter, which pushes Opcodes.NULL on stack in case of ACONST_NULL
> instruction.
>
> It's not reproducible with ASM 3.2.
>
> Could you please let me know if it's really an issue in ASM or just incorrect
> using of ASM by me?
message-footer.txt
(text/plain, 238 B)
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws