[svn:parrot] r31812 - trunk/src

Allison Randal allison at perl.org
Sat Oct 11 09:55:08 UTC 2008


chromatic at cvs.perl.org wrote:
> Author: chromatic
> Date: Wed Oct  8 20:55:25 2008
> New Revision: 31812
> 
> Modified:
>    trunk/src/inter_call.c
> 
> Log:
> [src] Fixed a memory leak in Parrot_pcc_invoke_sub_from_sig_object(), where
> nothing freed a C string created from the signature object.  I'm not completely
> convinced that this is correct, but Valgrind is happier now.
> 
> Modified: trunk/src/inter_call.c
> ==============================================================================
> --- trunk/src/inter_call.c	(original)
> +++ trunk/src/inter_call.c	Wed Oct  8 20:55:25 2008
[...]
>      interp->current_args   = save_current_args;
>      interp->args_signature = save_args_signature;
>      interp->current_object = save_current_object;
> +    string_cstring_free(signature);
>  }

This change is the cause of this warning in gcc:

src/inter_call.c: In function ‘Parrot_pcc_invoke_sub_from_sig_object’:
src/inter_call.c:2665: warning: passing argument 1 of 
‘string_cstring_free’ discards qualifiers from pointer target type

So, not the right fix.

Ultimately, the right fix is probably to update all those functions that 
expect a C string for the signature to take a Parrot STRING instead. 
Noted in the calling conventions tasklist.

Allison


More information about the parrot-dev mailing list