fix for issue #343
- the compiler now uses a temporary variable to hold the return value of a nested call across the restore-local-saves form to properly handle the case where the destination lvalue is an mref whose base and/or index is a local save. cpnanopass.ss, misc.ms original commit: 835cbc2430be4f7381cee27133d42e77ace2b37f
This commit is contained in:
parent
d3551a0173
commit
61df2f25f7
6
LOG
6
LOG
|
@ -991,3 +991,9 @@
|
|||
system.stex, release_notes.stex
|
||||
- fix boot_call and the invoke code object to handle multiple values
|
||||
scheme.c, cpnanopass.ss, 7.ms, release_notes.stex, system.stex
|
||||
- the compiler now uses a temporary variable to hold the return
|
||||
value of a nested call across the restore-local-saves form to
|
||||
properly handle the case where the destination lvalue is an mref
|
||||
whose base and/or index is a local save.
|
||||
cpnanopass.ss,
|
||||
misc.ms
|
||||
|
|
12
mats/misc.ms
12
mats/misc.ms
|
@ -272,6 +272,18 @@
|
|||
(case-lambda
|
||||
[() (q 0)]
|
||||
[(x) (q)])))
|
||||
; regression tests for non-tail-call mref lvalue destination
|
||||
(begin
|
||||
(define (c1-f a)
|
||||
(let ([x (fxvector 0)])
|
||||
(lambda (v) (fxvector-set! x 0 (modulo v a)) x)))
|
||||
#t)
|
||||
(equal? ((c1-f 7) 10) #vfx(3))
|
||||
(begin
|
||||
(define (c1-id x) x)
|
||||
(define (c1-g x) (vector-set-fixnum! x 0 (c1-id 17)))
|
||||
#t)
|
||||
(equal? (let ([v (vector 3)]) (c1-g v) v) '#(17))
|
||||
)
|
||||
|
||||
(mat compiler2 ; random tests
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
\thisversion{Version 9.5.1}
|
||||
\thatversion{Version 8.4}
|
||||
\pubmonth{January}
|
||||
\pubmonth{August}
|
||||
\pubyear{2018}
|
||||
|
||||
\begin{document}
|
||||
|
@ -1592,12 +1592,21 @@ in fasl files does not generally make sense.
|
|||
%-----------------------------------------------------------------------------
|
||||
\section{Bug Fixes}\label{section:bugfixes}
|
||||
|
||||
\subsection{Incorrect return code when \protect\scheme{exit} is called with multiple arguments}
|
||||
\subsection{Invalid memory reference from \protect\scheme{fxvector} calls (9.5)}
|
||||
|
||||
A compiler bug that could result in an invalid memory reference or
|
||||
some other unpleasant behavior for calls to \scheme{fxvector} in
|
||||
which the nested subexpression to compute the new value to be stored
|
||||
is nontrivial has been fixed.
|
||||
This bug could also affect calls to \scheme{vector-set-fixnum!} and possibly
|
||||
other primitive operations.
|
||||
|
||||
\subsection{Incorrect return code when \protect\scheme{exit} is called with multiple arguments (9.5)}
|
||||
|
||||
A bug in the implementation of the default exit handler with multiple
|
||||
values has been fixed.
|
||||
|
||||
\subsection{Boot files containing compiled library code fail to load}
|
||||
\subsection{Boot files containing compiled library code fail to load (9.5)}
|
||||
|
||||
Compiled library code may now appear within fasl objects loaded during
|
||||
the boot process, provided that they are appended to the end of the base boot
|
||||
|
|
|
@ -11313,7 +11313,12 @@
|
|||
[(set! ,[lvalue] (mvcall ,info ,mdcl ,t0? ,t1* ... (,t* ...)))
|
||||
(build-nontail-call info mdcl t0? t1* t* '() #f #f
|
||||
(lambda (newframe-info)
|
||||
(%seq (remove-frame ,newframe-info) (set! ,lvalue ,%ac0) (restore-local-saves ,newframe-info))))]
|
||||
(let ([retval (make-tmp 'retval)])
|
||||
(%seq
|
||||
(remove-frame ,newframe-info)
|
||||
(set! ,retval ,%ac0)
|
||||
(restore-local-saves ,newframe-info)
|
||||
(set! ,lvalue ,retval)))))]
|
||||
[(foreign-call ,info ,[t0] ,[t1*] ...)
|
||||
(build-foreign-call info t0 t1* #f #t)]
|
||||
[(set! ,[lvalue] (foreign-call ,info ,[t0] ,[t1*] ...))
|
||||
|
|
Loading…
Reference in New Issue
Block a user