[svn:parrot] r45228 - trunk/src/pmc

petdance at svn.parrot.org petdance at svn.parrot.org
Sun Mar 28 05:58:10 UTC 2010


Author: petdance
Date: Sun Mar 28 05:58:10 2010
New Revision: 45228
URL: https://trac.parrot.org/parrot/changeset/45228

Log:
protect args with ARG*() macros

Modified:
   trunk/src/pmc/complex.pmc
   trunk/src/pmc/coroutine.pmc

Modified: trunk/src/pmc/complex.pmc
==============================================================================
--- trunk/src/pmc/complex.pmc	Sun Mar 28 05:38:25 2010	(r45227)
+++ trunk/src/pmc/complex.pmc	Sun Mar 28 05:58:10 2010	(r45228)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2004-2009, Parrot Foundation.
+Copyright (C) 2004-2010, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -26,14 +26,16 @@
 /* HEADERIZER BEGIN: static */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
-static void complex_check_divide_zero(PARROT_INTERP, PMC *value)
-        __attribute__nonnull__(1);
+static void complex_check_divide_zero(PARROT_INTERP, ARGIN(PMC *value))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 static void float_check_divide_zero(PARROT_INTERP, FLOATVAL value)
         __attribute__nonnull__(1);
 
 #define ASSERT_ARGS_complex_check_divide_zero __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(value))
 #define ASSERT_ARGS_float_check_divide_zero __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
@@ -224,7 +226,7 @@
 }
 
 static void
-complex_check_divide_zero(PARROT_INTERP, PMC *value) {
+complex_check_divide_zero(PARROT_INTERP, ARGIN(PMC *value)) {
     /* Throw an exception if we are dividing by zero. Check both the real part
      * and the imaginary part.*/
     if (FLOAT_IS_ZERO(VTABLE_get_number_keyed_int(interp, value, 0))

Modified: trunk/src/pmc/coroutine.pmc
==============================================================================
--- trunk/src/pmc/coroutine.pmc	Sun Mar 28 05:38:25 2010	(r45227)
+++ trunk/src/pmc/coroutine.pmc	Sun Mar 28 05:58:10 2010	(r45228)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2009, Parrot Foundation.
+Copyright (C) 2001-2010, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -36,17 +36,19 @@
 /* HEADERIZER BEGIN: static */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
-static void print_sub_name(PARROT_INTERP, PMC *sub_pmc)
-        __attribute__nonnull__(1);
+static void print_sub_name(PARROT_INTERP, ARGIN(PMC *sub_pmc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 #define ASSERT_ARGS_print_sub_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(sub_pmc))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
 
 static void
-print_sub_name(PARROT_INTERP, PMC *sub_pmc)
+print_sub_name(PARROT_INTERP, ARGIN(PMC *sub_pmc))
 {
     /* It's actually a Parrot_coroutine, but this avoids casting warnings. */
     PMC           *ctx;
@@ -61,7 +63,7 @@
         "Calling" : "yielding from",
         Parrot_full_sub_name(interp, sub_pmc));
 
-    if (ctx && (PObj_get_FLAGS(sub_pmc) & SUB_FLAG_CORO_FF)) {
+    if (!PMC_IS_NULL(ctx) && (PObj_get_FLAGS(sub_pmc) & SUB_FLAG_CORO_FF)) {
         Parrot_io_eprintf(tracer, " to '%Ss'",
                 Parrot_full_sub_name(interp,
                     Parrot_pcc_get_sub(interp, Parrot_pcc_get_caller_ctx(interp, ctx))));
@@ -153,7 +155,7 @@
         opcode_t          *dest;
         PackFile_ByteCode *wanted_seg;
         opcode_t * const   next_op = (opcode_t *)next;
-        PMC               *signature = Parrot_pcc_get_signature(interp,
+        PMC      * const signature = Parrot_pcc_get_signature(interp,
                                             CURRENT_CONTEXT(interp));
 
         if (Interp_trace_TEST(INTERP, PARROT_TRACE_SUB_CALL_FLAG))


More information about the parrot-commits mailing list