[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [COMMITTED] pkl: Fix codegen of map operator
From: |
Jose E. Marchesi |
Subject: |
Re: [COMMITTED] pkl: Fix codegen of map operator |
Date: |
Thu, 16 Sep 2021 08:58:50 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Hi Mohammad.
Thanks for fixing this (and Guillermo for reporting).
I am a bit surprised no test detected this. It would be good to have at
least one, exercising the use case Guillermo reported, i.e. a map in an
l-value, several IO spaces open and the current IO id is not 0.
> Bug reported by Guillermo E. Martine.
>
> 2021-09-16 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
>
> * libpoke/pkl-gen.c (pkl_gen_pr_map): Use `PUSHIOS` instruction to
> get the current IOS, instead of using `PVM_NULL`.
> And also remove the old (incorrect) comment.
> ---
>
> Hi, Guillermo.
>
> Actually this was due to a bug in codegen. It used `PVM_NULL` instead of
> using the current IOS (that's why it poked the first IOS).
> Thanks for reporting this!
>
>
> Regards,
> Mohammad-Reza
>
>
> ChangeLog | 6 ++++++
> libpoke/pkl-gen.c | 3 +--
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index 5c614688..9fec1231 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,9 @@
> +2021-09-16 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
> +
> + * libpoke/pkl-gen.c (pkl_gen_pr_map): Use `PUSHIOS` instruction to
> + get the current IOS, instead of using `PVM_NULL`.
> + And also remove the old (incorrect) comment.
> +
> 2021-09-10 Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
>
> * doc/poke.texi (Weird Integers): Fix typo.
> diff --git a/libpoke/pkl-gen.c b/libpoke/pkl-gen.c
> index cfd95ae1..945d2cf8 100644
> --- a/libpoke/pkl-gen.c
> +++ b/libpoke/pkl-gen.c
> @@ -2447,7 +2447,7 @@ PKL_PHASE_BEGIN_HANDLER (pkl_gen_pr_map)
> PKL_GEN_POP_CONTEXT;
> }
> else
> - pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_PUSH, PVM_NULL);
> + pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_PUSHIOS);
>
> PKL_GEN_DUP_CONTEXT;
> PKL_GEN_CLEAR_CONTEXT (PKL_GEN_CTX_IN_LVALUE);
> @@ -2466,7 +2466,6 @@ PKL_PHASE_BEGIN_HANDLER (pkl_gen_pr_map)
> if (map_ios)
> PKL_PASS_SUBPASS (map_ios);
> else
> - /* PVM_NULL means use the current IO space, if any. */
> pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_PUSHIOS);
>
> /* Push the offset of the map and convert to a bit-offset. Note