emacs-bug-tracker
[Top][All Lists]
Advanced

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

bug#75457: closed ([PATCH guile-zlib] zlib.scm: Fix uncompress for nativ


From: GNU bug Tracking System
Subject: bug#75457: closed ([PATCH guile-zlib] zlib.scm: Fix uncompress for native 32-bit systems.)
Date: Sat, 18 Jan 2025 17:56:01 +0000

Your message dated Sat, 18 Jan 2025 18:55:29 +0100
with message-id <87wmest3am.fsf@gnu.org>
and subject line Re: bug#75457: [PATCH guile-zlib] zlib.scm: Fix uncompress for 
native 32-bit systems.
has caused the debbugs.gnu.org bug report #75457,
regarding [PATCH guile-zlib] zlib.scm: Fix uncompress for native 32-bit systems.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
75457: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75457
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH guile-zlib] zlib.scm: Fix uncompress for native 32-bit systems. Date: Thu, 9 Jan 2025 12:18:00 +0200
* zlib.scm (uncompress): Use the sizeof an unsigned-long for all size
calculations instead of forcing 64-bit integers.
---

I tested this (all the tests passed) using the guix.scm in the repo using:
guix build -f guix.scm
guix build -f guix.scm --system=i686-linux
guix build -f guix.scm --system=powerpc-linux (with offloading to an
actual powerpc-linux machine)

 zlib.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/zlib.scm b/zlib.scm
index 86ca4fc..a0702dc 100644
--- a/zlib.scm
+++ b/zlib.scm
@@ -425,9 +425,10 @@ require PORT to be a file port."
 the uncompressed data."
   (define (try-uncompress length)
     (let* ((dest (make-bytevector (* (sizeof uint8) length)))
-           (dest-length   (make-bytevector 8))
-           (source-length (make-bytevector 8)))
-      (bytevector-u64-set! source-length 0 length (native-endianness))
+           (dest-length   (make-bytevector (sizeof unsigned-long)))
+           (source-length (make-bytevector (sizeof unsigned-long))))
+      (bytevector-uint-set! source-length 0 length
+                            (native-endianness) (sizeof unsigned-long))
       (bytevector-uint-set! dest-length 0 length
                             (native-endianness) (sizeof unsigned-long))
       (let ((result (%uncompress2 (bytevector->pointer dest)

base-commit: cfaf683579a97630040efe4b7596af4bc519b05e
-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted




--- End Message ---
--- Begin Message --- Subject: Re: bug#75457: [PATCH guile-zlib] zlib.scm: Fix uncompress for native 32-bit systems. Date: Sat, 18 Jan 2025 18:55:29 +0100 User-agent: Gnus/5.13 (Gnus v5.13)
Efraim Flashner <efraim@flashner.co.il> skribis:

> * zlib.scm (uncompress): Use the sizeof an unsigned-long for all size
> calculations instead of forcing 64-bit integers.

Pushed as 7eb66708fb8db750d7175b750531a48e3f49d96d.

Interestingly i686 was fine, probably because it’s little endian so the
bug you had on powerpc didn’t show up.

Let’s see if there’s anything else to fix and if not, we should tag a
new version.

Thanks!

Ludo’.


--- End Message ---

reply via email to

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