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

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

[debbugs-tracker] bug#32644: closed (bytevector bug)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#32644: closed (bytevector bug)
Date: Sun, 14 Oct 2018 07:39:02 +0000

Your message dated Sun, 14 Oct 2018 03:38:11 -0400
with message-id <address@hidden>
and subject line Re: bug#32644: bytevector bug
has caused the debbugs.gnu.org bug report #32644,
regarding bytevector bug
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
32644: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32644
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: bytevector bug Date: Wed, 5 Sep 2018 19:53:02 +0200
Hi,

The code velow does not compile when the define-inlinable of id is active. If in stead
id defined by define is used it all compiles just fine.

Tested on latest tar ball for guile 2.4
-------------------------------------------
(use-modules (rnrs bytevectors))

(define-inlinable (id x) x)
;(define (id x) x)
(define-syntax-rule (mkcrc crc_hqx high xor mask)
  (define (crc_hqx data value)
       (let ((n (bytevector-length data))
     (d data))
(let lp ((i 0) (v value))
   (if (< i n)
       (let ((b (id (bytevector-u8-ref d i))))
(let lp2 ((j 0) (x 1) (v v))
   (if (> j -8)
       (let ((bit   (ash (logand x b) j))
     (hbit  (logand v high)))
(if (= hbit 0)
     (lp2 (- j 1) (ash x 1) (logior bit (ash v 1)))
     (lp2 (- j 1) (ash x 1) (logxor
     xor
     (logand mask
     (logior
      bit
      (ash v 1)))))))
       (lp (+ i 1) v))))
       v)))))

(mkcrc crc_hqx #x8000     #x1021     #xffff)
(mkcrc crc32   #x80000000 #x04c11db7 #xffffffff)


--- End Message ---
--- Begin Message --- Subject: Re: bug#32644: bytevector bug Date: Sun, 14 Oct 2018 03:38:11 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Stefan Israelsson Tampe <address@hidden> writes:
> The code velow does not compile when the define-inlinable of id is active. If 
> in stead
> id defined by define is used it all compiles just fine.

The problem was that, in some cases, the type inferrer would call 'ash'
with (- 1 (expt 2 64)) as the second argument during compilation.  The
implementation of 'ash' would raise an exception unless its second
argument (the shift count) fits in a C 'long'.

This is fixed in commit 011aec7e240ef987931548d90c53e6692c85d01c on the
stable-2.2 branch.  That commit extends 'ash' and 'round-ash' to
gracefully handle several cases where the shift count is too large to
fit in a 'long'.

Thanks for the report.

      Mark


--- End Message ---

reply via email to

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