[svn:parrot] r49022 - trunk/src/ops

Jonathan Leto jonathan at leto.net
Thu Sep 16 08:22:05 UTC 2010


Howdy,

Can we get a test for this?

Duke


On Wed, Sep 15, 2010 at 10:53 AM, <luben at parrot.org> wrote:

> Author: luben
> Date: Wed Sep 15 17:53:37 2010
> New Revision: 49022
> URL: https://trac.parrot.org/parrot/changeset/49022
>
> Log:
> fix bug in logical not on PMCs when dest == src
>
> Introduced in logical vtables removal
>
> Modified:
>   trunk/src/ops/cmp.ops
>   trunk/src/ops/core_ops.c
>
> Modified: trunk/src/ops/cmp.ops
>
> ==============================================================================
> --- trunk/src/ops/cmp.ops       Wed Sep 15 17:44:16 2010        (r49021)
> +++ trunk/src/ops/cmp.ops       Wed Sep 15 17:53:37 2010        (r49022)
> @@ -958,8 +958,10 @@
>  }
>
>  inline op not(out PMC, invar PMC) :base_core {
> -    $1 = Parrot_pmc_new(interp, VTABLE_type(interp, $2));
> -    VTABLE_set_bool(interp, $1, (!VTABLE_get_bool(interp, $2)));
> +    const INTVAL a = ! VTABLE_get_bool(interp, $2);
> +    if (PMC_IS_NULL($1))
> +        $1 = Parrot_pmc_new(interp, VTABLE_type(interp, $2));
> +    VTABLE_set_bool(interp, $1, a);
>  }
>
>  ########################################
>
> Modified: trunk/src/ops/core_ops.c
>
> ==============================================================================
> --- trunk/src/ops/core_ops.c    Wed Sep 15 17:44:16 2010        (r49021)
> +++ trunk/src/ops/core_ops.c    Wed Sep 15 17:53:37 2010        (r49022)
> @@ -18239,8 +18239,10 @@
>  opcode_t *
>  Parrot_not_p_p(opcode_t *cur_opcode, PARROT_INTERP)  {
>     const Parrot_Context * const CUR_CTX =
> Parrot_pcc_get_context_struct(interp, interp->ctx);
> -    PREG(1) = Parrot_pmc_new(interp, VTABLE_type(interp, PREG(2)));
> -    VTABLE_set_bool(interp, PREG(1), (!VTABLE_get_bool(interp, PREG(2))));
> +    const INTVAL a = ! VTABLE_get_bool(interp, PREG(2));
> +    if (PMC_IS_NULL(PREG(1)))
> +        PREG(1) = Parrot_pmc_new(interp, VTABLE_type(interp, PREG(2)));
> +    VTABLE_set_bool(interp, PREG(1), a);
>
>  return (opcode_t *)cur_opcode + 3;}
>
> _______________________________________________
> http://lists.parrot.org/mailman/listinfo/parrot-commits
>



-- 
Jonathan "Duke" Leto
jonathan at leto.net
http://leto.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.parrot.org/pipermail/parrot-dev/attachments/20100916/0606b7e0/attachment.html>


More information about the parrot-dev mailing list