# New Ticket Created by  Bram Geron 
# Please include the string:  [perl #46597]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=46597 >


In Parrot_init_arg_indexes_and_sig_pmc, the `sig_pmc' and `indexes'
arguments are declared NOTNULL. However, it is called by
Parrot_init_arg_sig, which has a NULLOK argument `pc', and if pc is null
then Parrot_init_arg_indexes_and_sig_pmc is called with null args
`sig_pmc' and `indexes'. Contradiction.

Also, there are if statements inside Parrot_init_arg_indexes_and_sig_pmc
checking nullity of `sig_pmc' and `indexes', so I suggest we turn the
NOTNULL into a NULLOK there. When I run the tests with an assert(sig_pmc
&& indexes), some fail, so that confirms the contradiction. Attached
patch makes the two arguments NULLOK.

-- 
Bram Geron | GPG 0xE7B9E65E
diff --git a/src/inter_call.c b/src/inter_call.c
index fe129c3..c55bc8a 100644
--- a/src/inter_call.c
+++ b/src/inter_call.c
@@ -226,7 +226,7 @@ These functions return 0, if no arguments are present, or 1 
on success.
 PARROT_API
 int
 Parrot_init_arg_indexes_and_sig_pmc(PARROT_INTERP, NOTNULL(parrot_context_t 
*ctx),
-        NOTNULL(opcode_t *indexes), NOTNULL(PMC* sig_pmc), 
NOTNULL(call_state_item *sti))
+        NULLOK(opcode_t *indexes), NULLOK(PMC* sig_pmc), 
NOTNULL(call_state_item *sti))
 {
     UNUSED(interp);
 

Reply via email to