poke-devel
[Top][All Lists]
Advanced

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

[COMMITTED 1/2] poked: poked.pk: fix poked_chan_send to copy data into b


From: Mohammad-Reza Nabipoor
Subject: [COMMITTED 1/2] poked: poked.pk: fix poked_chan_send to copy data into buffer
Date: Sat, 17 Sep 2022 22:38:05 +0430

2022-09-17  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>

        * poked/poked.pk (poked_chan_send): Force Poke to make a copy of
        data before putting into the buffer.
---
 ChangeLog      | 6 ++++++
 poked/poked.pk | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 89dc0b73..660dfca7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-09-17  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>
+
+       * poked/poked.pk (poked_chan_send): Force Poke to make a copy of
+       data before putting into the buffer.
+
+
 2022-09-01  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>
 
        * libpoke/pkl-lex.l (IS): Add lower-case b to `IS' definition.
diff --git a/poked/poked.pk b/poked/poked.pk
index 18121bd3..718329f1 100644
--- a/poked/poked.pk
+++ b/poked/poked.pk
@@ -56,7 +56,7 @@ fun poked_chan_send = (uint<7> chan, byte[] data) void:
     assert (0 < chan && chan <= 120);
 
     apush (__poked_chan_send_chan, chan);
-    apush (__poked_chan_send_buf, data);
+    apush (__poked_chan_send_buf, data + byte[0] ()); // Force a copy
     __poked_chan_send_p = 1;
   }
 
-- 
2.37.3




reply via email to

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