Skip to content

Commit

Permalink
Fix in-range? contract to allow "writing" empty u8vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
drewc committed Oct 16, 2024
1 parent 9d666da commit 64b7741
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/gerbil/runtime/util.ss
Original file line number Diff line number Diff line change
Expand Up @@ -755,9 +755,11 @@ 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 :~ (in-range? 0 (max 1 (u8vector-length bytes)))
:- :fixnum
:= 0)
(end :~ (in-range-inclusive? start (u8vector-length bytes))
:- :fixnum
:= (u8vector-length bytes)))
=> :void
(:- (##write-subu8vector bytes start end port)
Expand Down

0 comments on commit 64b7741

Please sign in to comment.