poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/5] pvm.jitter: fix `iolist' to have right type


From: Jose E. Marchesi
Subject: Re: [PATCH 3/5] pvm.jitter: fix `iolist' to have right type
Date: Mon, 24 Oct 2022 00:05:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> 2022-10-23  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>
>
>       * libpoke/pvm.jitter (iolist): Create an array with right type.
> ---
>  ChangeLog          | 4 ++++
>  libpoke/pvm.jitter | 7 ++++---
>  2 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index b05d74ef..6976f2cf 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,7 @@
> +2022-10-23  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>
> +
> +     * libpoke/pvm.jitter (iolist): Create an array with right type.
> +
>  2022-10-23  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>
>  
>       * libpoke/pkl-insn.def (PKL_INSN_TYSCTN): Removed.
> diff --git a/libpoke/pvm.jitter b/libpoke/pvm.jitter
> index 8fe50780..05a89c19 100644
> --- a/libpoke/pvm.jitter
> +++ b/libpoke/pvm.jitter
> @@ -1822,9 +1822,10 @@ end
>  instruction iolist ()
>    code
>      struct iolist_ctx iolist_ctx;
> -    pvm_val arr = pvm_make_array (pvm_make_integral_type (PVM_MAKE_ULONG 
> (32, 64),
> -                                                          PVM_MAKE_INT (1, 
> 32)),
> -                                  PVM_MAKE_ULONG (0, 64));
> +    pvm_val arr_etype = pvm_make_integral_type (PVM_MAKE_ULONG (32, 64),
> +                                                PVM_MAKE_INT (1, 32));
> +    pvm_val arr_type = pvm_make_array_type (arr_etype, PVM_NULL);

The bound in the array type cannot be PVM_NULL.  It must be a closure
with signature ()void that once executed returns PVM_NULL.

It is probably a good idea to have a function

  pvm_make_unbounded_array_type (ETYPE)

that uses such a closure internally.  I suggest to define that closure
as a RAS function.

> +    pvm_val arr = pvm_make_array (PVM_MAKE_ULONG (0, 64), arr_type);
>
>      iolist_ctx.arr_ios = arr;
>      ios_map (iolist_callback, &iolist_ctx);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]