On Tuesday 20 February 2007 19:01, [EMAIL PROTECTED] wrote:

> Modified:
>    trunk/src/stm/backend.c
>
> Log:
> [stm]: don't access a null pointer
>
> Modified: trunk/src/stm/backend.c
> ===========================================================================
>=== --- trunk/src/stm/backend.c        (original)
> +++ trunk/src/stm/backend.c   Tue Feb 20 19:01:12 2007
> @@ -1338,6 +1338,9 @@
>  void Parrot_STM_destroy_extracted(Interp *interp, void *saved_log_data) {
>      STM_saved_tx_log *saved;
>
> +    if (saved_log_data == NULL)
> +        return;
> +
>      saved = saved_log_data;
>      mem_sys_free(saved->reads);
>      mem_sys_free(saved->writes);

I'm not sure this is the right fix; there's little reason to use an STMLog PMC 
if it doesn't get a valid transaction log.  My vote is for the PMC's init() 
to throw an exception.

If that's not the case, then at least both of Parrot_STM_mark_extracted() and 
Parrot_STM_replay_extracted() need similar null guards.

-- c

Reply via email to