[svn:parrot] r45363 - trunk/lib/Parrot/Ops2c

petdance at svn.parrot.org petdance at svn.parrot.org
Wed Mar 31 22:10:36 UTC 2010


Author: petdance
Date: Wed Mar 31 22:10:35 2010
New Revision: 45363
URL: https://trac.parrot.org/parrot/changeset/45363

Log:
protect the args passed into the generated funcs

Modified:
   trunk/lib/Parrot/Ops2c/Utils.pm

Modified: trunk/lib/Parrot/Ops2c/Utils.pm
==============================================================================
--- trunk/lib/Parrot/Ops2c/Utils.pm	Wed Mar 31 20:21:24 2010	(r45362)
+++ trunk/lib/Parrot/Ops2c/Utils.pm	Wed Mar 31 22:10:35 2010	(r45363)
@@ -893,8 +893,8 @@
 static HOP **hop;
 
 static void hop_init(PARROT_INTERP);
-static size_t hash_str(const char *str);
-static void store_op(PARROT_INTERP, op_info_t *info, int full);
+static size_t hash_str(ARGIN_NULLOK(const char *str));
+static void store_op(PARROT_INTERP, ARGIN(op_info_t *info), int full);
 
 /* XXX on changing interpreters, this should be called,
    through a hook */
@@ -911,7 +911,8 @@
  * returns >= 0 (found idx into info_table), -1 if not
  */
 
-static size_t hash_str(const char *str) {
+static size_t hash_str(ARGIN_NULLOK(const char *str))
+{
     size_t      key = 0;
     const char *s   = str;
 
@@ -923,7 +924,8 @@
     return key;
 }
 
-static void store_op(PARROT_INTERP, op_info_t *info, int full) {
+static void store_op(PARROT_INTERP, ARGIN(op_info_t *info), int full)
+{
     HOP * const p     = mem_gc_allocate_zeroed_typed(interp, HOP);
     const size_t hidx =
         hash_str(full ? info->full_name : info->name) % OP_HASH_SIZE;
@@ -945,7 +947,8 @@
     }
     return -1;
 }
-static void hop_init(PARROT_INTERP) {
+static void hop_init(PARROT_INTERP)
+{
     size_t i;
     op_info_t * const info = $self->{bs}op_lib.op_info_table;
     /* store full names */


More information about the parrot-commits mailing list