[svn:parrot] r36389 - trunk/src

NotFound at svn.parrot.org NotFound at svn.parrot.org
Fri Feb 6 00:24:09 UTC 2009


Author: NotFound
Date: Fri Feb  6 00:24:09 2009
New Revision: 36389
URL: https://trac.parrot.org/parrot/changeset/36389

Log:
[core] fix check_named read out of bounds, TT #233, kjs++

Modified:
   trunk/src/inter_call.c

Modified: trunk/src/inter_call.c
==============================================================================
--- trunk/src/inter_call.c	Thu Feb  5 23:01:54 2009	(r36388)
+++ trunk/src/inter_call.c	Fri Feb  6 00:24:09 2009	(r36389)
@@ -22,7 +22,6 @@
 #include "parrot/parrot.h"
 #include "parrot/oplib/ops.h"
 #include "inter_call.str"
-#include "pmc/pmc_fixedintegerarray.h"
 
 /* HEADERIZER HFILE: include/parrot/inter_call.h */
 
@@ -1405,15 +1404,14 @@
 
             /* if this named arg is already filled, continue */
             if (st->named_done & (1 << n_named)) {
-                /* XXX: This reads past the end of the array. TT #233*/
-                INTVAL* int_array;
-                GETATTR_FixedIntegerArray_int_array(interp,
-                        st->dest.u.op.signature, int_array);
-                arg_sig = st->dest.sig = int_array[i+1];
-
-                /* skip associated opt flag arg as well */
-                if (arg_sig & PARROT_ARG_OPT_FLAG)
-                    i++;
+                if (i + 1 < st->dest.n) {
+                    arg_sig = st->dest.sig = VTABLE_get_integer_keyed_int(interp,
+                            st->dest.u.op.signature, i + 1);
+
+                    /* skip associated opt flag arg as well */
+                    if (arg_sig & PARROT_ARG_OPT_FLAG)
+                        i++;
+                }
 
                 continue;
             }


More information about the parrot-commits mailing list