diff --git a/LOG b/LOG index 41675d405a..086540306a 100644 --- a/LOG +++ b/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 diff --git a/mats/misc.ms b/mats/misc.ms index bdee118006..215e5b3c0a 100644 --- a/mats/misc.ms +++ b/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 diff --git a/release_notes/release_notes.stex b/release_notes/release_notes.stex index 0aea7d3242..0ad6eac72d 100644 --- a/release_notes/release_notes.stex +++ b/release_notes/release_notes.stex @@ -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 diff --git a/s/cpnanopass.ss b/s/cpnanopass.ss index ecd45d841e..19699e1cb1 100644 --- a/s/cpnanopass.ss +++ b/s/cpnanopass.ss @@ -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*] ...))