Skip to content

Commit

Permalink
Merge fix for 32-bit emacs.
Browse files Browse the repository at this point in the history
Fix is from the ELPA repository, commit
42e566c946db8fc8b170a13c3bdff60cbf2807b0, by Paul Eggert.

Original commit message:
Port websocket to bleeding-edge 32-bit Emacs

    Problem reported by Stefan Monnier (Bug#31118).
    * packages/websocket/websocket.el (websocket-to-bytes):
    Do not assume that #xffffffff is a valid fixnum.
  • Loading branch information
ahyatt committed Apr 23, 2018
1 parent de26889 commit 0d96ba2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions websocket.el
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,9 @@ approximately 537M long."
val nbytes))
(if (= nbytes 8)
(progn
(let ((hi-32bits (lsh val -32))
;; Test for systems that don't have > 32 bits, and
;; for those systems just return the value.
(low-32bits (if (= 0 (expt 2 32))
val
(logand #xffffffff val))))
(let* ((hi-32bits (lsh val -32))
;; This is just VAL on systems that don't have >= 32 bits.
(low-32bits (- val (lsh hi-32bits 32))))
(when (or (> hi-32bits 0) (> (lsh low-32bits -29) 0))
(signal 'websocket-frame-too-large val))
(bindat-pack `((:val vec 2 u32))
Expand Down

0 comments on commit 0d96ba2

Please sign in to comment.