From f17d94056f71201a4276732a242ea1f2157faeef Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 9 May 2011 12:24:05 -0600 Subject: [PATCH] fix tl-map parse & marshal original commit: 8ad8d5b7f7f0d21ae3d7396d8b61fa3949985f9f --- collects/compiler/zo-marshal.rkt | 7 ++++--- collects/compiler/zo-parse.rkt | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/collects/compiler/zo-marshal.rkt b/collects/compiler/zo-marshal.rkt index a626ac7a7a..9438fc71aa 100644 --- a/collects/compiler/zo-marshal.rkt +++ b/collects/compiler/zo-marshal.rkt @@ -978,13 +978,14 @@ num-all-params max-let-depth (and tl-map - (if (tl-map . < . #x7FFFFFFF) + (if (tl-map . <= . #xFFFFFFF) + ;; Encode as a fixnum: tl-map ;; Encode as an even-sized vector of 16-bit integers: (let ([len (* 2 (quotient (+ (integer-length tl-map) 31) 32))]) (for/vector ([i (in-range len)]) - (let ([s (* i 16)]) - (bitwise-bit-field tl-map s (+ s 16))))))) + (let ([s (* i 16)]) + (bitwise-bit-field tl-map s (+ s 16))))))) name l) out))])) diff --git a/collects/compiler/zo-parse.rkt b/collects/compiler/zo-parse.rkt index ac27f36b56..66ee70a765 100644 --- a/collects/compiler/zo-parse.rkt +++ b/collects/compiler/zo-parse.rkt @@ -136,9 +136,9 @@ (and tl-map (let* ([bits (if (exact-integer? tl-map) tl-map - (for/fold ([i 0]) ([v (in-list tl-map)] + (for/fold ([i 0]) ([v (in-vector tl-map)] [s (in-naturals)]) - (bitwise-ior i (arithmetic-shift v 16))))] + (bitwise-ior i (arithmetic-shift v (* s 16)))))] [len (integer-length bits)]) (list->set (let loop ([bit 0])