When method's argument was [D then 'c' value was incorrectly
decremented. Use parse_method_args() to avoid code redundancy.

Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>
---
 jit/invoke-bc.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/jit/invoke-bc.c b/jit/invoke-bc.c
index e65de6c..80c414d 100644
--- a/jit/invoke-bc.c
+++ b/jit/invoke-bc.c
@@ -53,17 +53,14 @@ int convert_return(struct parse_context *ctx)
 static unsigned int method_real_argument_count(struct vm_method *invoke_target)
 {
        unsigned int c = invoke_target->args_count;
-       char * a = invoke_target->type;
+       const char * a = invoke_target->type;
+       enum vm_type vmtype;
 
-       /* FIXME: Make more robust, verify correctness. */
-       while (*(a++) != ')') {
-               if (*a == 'J' || *a == 'D')
+       /* FIXME: Make more robust. */
+       while ((a = parse_method_args(a, &vmtype)))
+               if (vmtype == J_LONG || vmtype == J_DOUBLE)
                        c--;
-               if (*a == 'L') {
-                       while (*(++a) != ';')
-                               ;
-               }
-       }
+
        return c;
 }
 
-- 
1.6.0.6


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to