fix open-string-input-port
on immutable strings
original commit: 48b0ace8b6fba756d8573698db4244472c64255f
This commit is contained in:
parent
399e0fa924
commit
5053fbb98d
2
LOG
2
LOG
|
@ -1372,3 +1372,5 @@
|
||||||
5_2.ms
|
5_2.ms
|
||||||
- added support for Microsoft Visual Studio 2019 on Windows
|
- added support for Microsoft Visual Studio 2019 on Windows
|
||||||
BUILDING, c/vs.bat, wininstall/locate-vcredist.bat
|
BUILDING, c/vs.bat, wininstall/locate-vcredist.bat
|
||||||
|
- fixed open-string-input-port on immutable strings
|
||||||
|
cpnanopass.ss, io.ms, release_notes.stex
|
||||||
|
|
15
mats/io.ms
15
mats/io.ms
|
@ -105,8 +105,9 @@
|
||||||
(let ([c (get-u8 p)])
|
(let ([c (get-u8 p)])
|
||||||
(cons (integer->char c) (f)))))))))
|
(cons (integer->char c) (f)))))))))
|
||||||
"a b c d e")
|
"a b c d e")
|
||||||
|
(andmap (lambda (p)
|
||||||
(equal? (call-with-port
|
(equal? (call-with-port
|
||||||
(open-file-input-port "testfile.ss")
|
p
|
||||||
(lambda (p)
|
(lambda (p)
|
||||||
(list->string
|
(list->string
|
||||||
(let f ()
|
(let f ()
|
||||||
|
@ -115,7 +116,10 @@
|
||||||
'()
|
'()
|
||||||
(let ([c (get-u8 p)])
|
(let ([c (get-u8 p)])
|
||||||
(cons (integer->char c) (f)))))))))
|
(cons (integer->char c) (f)))))))))
|
||||||
"a b c d e")
|
"a b c d e"))
|
||||||
|
(list (open-file-input-port "testfile.ss")
|
||||||
|
(open-bytevector-input-port '#vu8(97 32 98 32 99 32 100 32 101))
|
||||||
|
(open-bytevector-input-port (bytevector->immutable-bytevector '#vu8(97 32 98 32 99 32 100 32 101)))))
|
||||||
; test various errors related to input ports
|
; test various errors related to input ports
|
||||||
(begin (set! ip (open-file-input-port "testfile.ss"))
|
(begin (set! ip (open-file-input-port "testfile.ss"))
|
||||||
(and (port? ip) (input-port? ip)))
|
(and (port? ip) (input-port? ip)))
|
||||||
|
@ -1292,8 +1296,9 @@
|
||||||
(define $bop (let-values ([(op get) (open-bytevector-output-port)]) (set-binary-port-output-buffer! op #vu8(1 2 3 4 5)) op))
|
(define $bop (let-values ([(op get) (open-bytevector-output-port)]) (set-binary-port-output-buffer! op #vu8(1 2 3 4 5)) op))
|
||||||
#t)
|
#t)
|
||||||
; textual input
|
; textual input
|
||||||
|
(andmap (lambda (str)
|
||||||
(equal?
|
(equal?
|
||||||
(let ([ip (open-string-input-port "hello")])
|
(let ([ip (open-string-input-port str)])
|
||||||
(let ([buffer0 (textual-port-input-buffer ip)]
|
(let ([buffer0 (textual-port-input-buffer ip)]
|
||||||
[index0 (textual-port-input-index ip)]
|
[index0 (textual-port-input-index ip)]
|
||||||
[size0 (textual-port-input-size ip)]
|
[size0 (textual-port-input-size ip)]
|
||||||
|
@ -1306,7 +1311,9 @@
|
||||||
(textual-port-input-index ip)
|
(textual-port-input-index ip)
|
||||||
(textual-port-input-size ip)
|
(textual-port-input-size ip)
|
||||||
(textual-port-input-count ip)))))
|
(textual-port-input-count ip)))))
|
||||||
'(("hello" 0 5 5) ("hello" 1 5 4)))
|
'(("hello" 0 5 5) ("hello" 1 5 4))))
|
||||||
|
(list "hello"
|
||||||
|
(string->immutable-string "hello")))
|
||||||
(equal?
|
(equal?
|
||||||
(let ([ip (open-string-input-port "hello")])
|
(let ([ip (open-string-input-port "hello")])
|
||||||
(let ([buffer0 (textual-port-input-buffer ip)]
|
(let ([buffer0 (textual-port-input-buffer ip)]
|
||||||
|
|
|
@ -1695,6 +1695,12 @@ in fasl files does not generally make sense.
|
||||||
%-----------------------------------------------------------------------------
|
%-----------------------------------------------------------------------------
|
||||||
\section{Bug Fixes}\label{section:bugfixes}
|
\section{Bug Fixes}\label{section:bugfixes}
|
||||||
|
|
||||||
|
\subsection{String ports form immutable strings (9.5.4)}
|
||||||
|
|
||||||
|
A bug that miscalculated the buffer size for
|
||||||
|
\scheme{open-string-input-port} given an immutable string has been
|
||||||
|
fixed.
|
||||||
|
|
||||||
\subsection{Multiplying $-2^{30}$ with itself on 64-bit platforms (9.5.3)}
|
\subsection{Multiplying $-2^{30}$ with itself on 64-bit platforms (9.5.3)}
|
||||||
|
|
||||||
A bug that produced the wrong sign when multiplying $-2^{30}$ with
|
A bug that produced the wrong sign when multiplying $-2^{30}$ with
|
||||||
|
|
|
@ -7681,9 +7681,9 @@
|
||||||
(build-dirty-store e-p ibuffer-disp e-b))
|
(build-dirty-store e-p ibuffer-disp e-b))
|
||||||
,(bind #t ([e-length (if (eq? port-type 'textual)
|
,(bind #t ([e-length (if (eq? port-type 'textual)
|
||||||
(translate
|
(translate
|
||||||
(%inline logxor
|
(%inline logand
|
||||||
,(%mref ,e-b ,(constant string-type-disp))
|
,(%mref ,e-b ,(constant string-type-disp))
|
||||||
,(%constant type-string))
|
(immediate ,(fx- (expt 2 (constant string-length-offset)))))
|
||||||
(constant string-length-offset)
|
(constant string-length-offset)
|
||||||
(constant string-char-offset))
|
(constant string-char-offset))
|
||||||
(%inline srl
|
(%inline srl
|
||||||
|
|
Loading…
Reference in New Issue
Block a user