poke-devel
[Top][All Lists]
Advanced

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

[COMMITTED] pvm: add `pvm_sizeof (PVM_NULL) == 0`


From: Mohammad-Reza Nabipoor
Subject: [COMMITTED] pvm: add `pvm_sizeof (PVM_NULL) == 0`
Date: Sun, 22 Jan 2023 00:08:40 +0100

2023-01-23  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>

        * libpoke/pvm-val.c (pvm_sizeof): Add case for `PVM_NULL'.
        * libpoke/pvm.jitter (siz): Add a comment describing special
        cases.
---
 ChangeLog          | 6 ++++++
 libpoke/pvm-val.c  | 3 +++
 libpoke/pvm.jitter | 2 ++
 3 files changed, 11 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index b67d08b9..0ee67684 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-01-23  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>
+
+       * libpoke/pvm-val.c (pvm_sizeof): Add case for `PVM_NULL'.
+       * libpoke/pvm.jitter (siz): Add a comment describing special
+       cases.
+
 2023-01-20  Jose E. Marchesi  <jemarch@gnu.org>
 
        * configure.ac: Report missing gensub-capable awk at configure
diff --git a/libpoke/pvm-val.c b/libpoke/pvm-val.c
index 2c6175dc..2903b1e5 100644
--- a/libpoke/pvm-val.c
+++ b/libpoke/pvm-val.c
@@ -986,6 +986,9 @@ pvm_sizeof (pvm_val val)
   else if (PVM_IS_CLS (val))
     /* By convention, closure values have size zero.  */
     return 0;
+  else if (val == PVM_NULL)
+    /* By convention, PVM_NULL values have size zero.  */
+    return 0;
 
   assert (0);
   return 0;
diff --git a/libpoke/pvm.jitter b/libpoke/pvm.jitter
index af20229e..8f7f33aa 100644
--- a/libpoke/pvm.jitter
+++ b/libpoke/pvm.jitter
@@ -6875,6 +6875,8 @@ end
 # Instruction: siz
 #
 # Given a value, push its size as a bit-offset.
+# By convention, the following PVM values have size zero:
+#   type, closure, null
 #
 # Stack: ( VAL -- VAL ULONG )
 
-- 
2.39.1




reply via email to

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