From 0a91788acad74dd6292e4c4642ec99d0df7c0404 Mon Sep 17 00:00:00 2001 From: Drew Crampsie Date: Wed, 23 Oct 2024 12:54:24 -0700 Subject: [PATCH] Fix in-range? contract to allow "writing" empty u8vectors (#1275) --- src/gerbil/runtime/util.ss | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gerbil/runtime/util.ss b/src/gerbil/runtime/util.ss index 79cf64dca..c8d166cdf 100644 --- a/src/gerbil/runtime/util.ss +++ b/src/gerbil/runtime/util.ss @@ -755,9 +755,8 @@ namespace: #f (def (write-u8vector (bytes : :u8vector) (port :~ output-port? :- :port) - (start :~ (in-range? 0 (u8vector-length bytes)) :- :fixnum - := 0) - (end :~ (in-range-inclusive? start (u8vector-length bytes)) :- :fixnum + (start :- :fixnum := 0) + (end :~ (in-range-inclusive? start (u8vector-length bytes)) :- :fixnum := (u8vector-length bytes))) => :void (:- (##write-subu8vector bytes start end port)