[PATCH guile-zlib] zlib.scm: Fix uncompress for native 32-bit systems.

  • Open
  • quality assurance status badge
Details
One participant
  • Efraim Flashner
Owner
unassigned
Submitted by
Efraim Flashner
Severity
normal

Debbugs page

E
E
Efraim Flashner wrote 34 hours ago
(name . Efraim Flashner)(address . efraim@flashner.co.il)
ba54947857f51c8f1cfb1f2efbb96ecc778494cb.1736417843.git.efraim@flashner.co.il
* 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(-)

Toggle diff (24 lines)
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
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 75457@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 75457
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch