This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA/JVMTI] Small fix to GetArgumentsSize


This patch is a small fix to the method signature parsing in GetArgumentsSize. In the case where one of the arguments is an array of longs or doubles, the current code would incorrectly count this as taking up two slots (to hold the wide type). This patch changes this so that if it is an array of wide types, not just a single value, it correctly counts this as a single slot holding the array reference.

Questions/Comments/Concerns?

- Kyle
Index: /notnfs/kgallowa/gcc-alternate/libjava/jvmti.cc
===================================================================
--- /notnfs/kgallowa/gcc-alternate/libjava/jvmti.cc	(revision 122638)
+++ /notnfs/kgallowa/gcc-alternate/libjava/jvmti.cc	(working copy)
@@ -1111,7 +1111,13 @@
           || sig[i] == 'I' || sig[i] == 'F')
         num_slots++;
       else if (sig[i] == 'J' || sig[i] == 'D')
-        num_slots+=2;
+        {
+          // If this is an array of wide types it uses a single slot
+          if (i > 0 && sig[i-1] == '[')
+            num_slots++;
+          else
+            num_slots += 2;
+        }
       else if (sig[i] == 'L')
         {
           num_slots++;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]