[jboss-jira] [JBoss JIRA] (JASSIST-158) Method calls with a parameter of long[] or double[] are compiled to incorrect bytecode resulting in errors such as java.lang.VerifyError: ... Inconsistent args_size for opc_invokeinterface
Scott Marlow (JIRA)
jira-events at lists.jboss.org
Thu Sep 5 16:32:04 EDT 2013
[ https://issues.jboss.org/browse/JASSIST-158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Scott Marlow updated JASSIST-158:
---------------------------------
Fix Version/s: 3.18.1-GA
> Method calls with a parameter of long[] or double[] are compiled to incorrect bytecode resulting in errors such as java.lang.VerifyError: ... Inconsistent args_size for opc_invokeinterface
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: JASSIST-158
> URL: https://issues.jboss.org/browse/JASSIST-158
> Project: Javassist
> Issue Type: Bug
> Affects Versions: 3.16.1-GA
> Reporter: Jens Deppe
> Assignee: Shigeru Chiba
> Fix For: 3.18.1-GA, 3.19.0-GA
>
>
> I believe this patch fixes the problem:
> Method calls with a parameter of long[] or double[] are compiled to incorrect bytecode. For example, the following piece of code...
> {code}
> long[] aLongArray;
> PdxWriter writer;
> ...
> writer.writeLongArray("aLongArray", aLongArray);
> {code}
> Produces code similar to this:
> {code}
> 13: aload_1
> 14: ldc #32; //String aLongArray
> 16: aload_0
> 17: getfield #35; //Field aLongArray:[J
> 20: invokeinterface #39, 4; //InterfaceMethod com/gemstone/gemfire/pdx/PdxWriter.writeLongArray:(Ljava/lang/String;[J)Lcom/gemstone/gemfire/pdx/PdxWriter;
> 25: pop
> {code}
> Following the code, it looks like getfield calculates an incorrect stackdepth when applied to a long[] or double[], resulting in an incorrect number of args applied to invokeinterface.
> The following patch seems to fix things.
> {code}
> Index: src/main/javassist/compiler/MemberCodeGen.java
> ===================================================================
> --- src/main/javassist/compiler/MemberCodeGen.java (revision 624)
> +++ src/main/javassist/compiler/MemberCodeGen.java (working copy)
> @@ -957,7 +957,7 @@
> else
> className = null;
>
> - boolean is2byte = (c == 'J' || c == 'D');
> + boolean is2byte = ((c == 'J' || c == 'D') && dim == 0);
> return is2byte;
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list