From 7801893e3d565a514fdb34de66cb4fc6ca00761d Mon Sep 17 00:00:00 2001 From: dtc <dtc> Date: Tue, 26 Sep 2000 16:39:30 +0000 Subject: [PATCH] o Within generate-byte-code-for-set, avoid trying to set a lexical variable with no refs since the compiler deletes such variables. --- compiler/byte-comp.lisp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/compiler/byte-comp.lisp b/compiler/byte-comp.lisp index 68eaa5d9e..6240b6215 100644 --- a/compiler/byte-comp.lisp +++ b/compiler/byte-comp.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/byte-comp.lisp,v 1.28 2000/06/14 06:23:35 dtc Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/byte-comp.lisp,v 1.29 2000/09/26 16:39:30 dtc Exp $") ;;; ;;; ********************************************************************** ;;; @@ -1353,17 +1353,24 @@ (values (if info (byte-continuation-info-results info) 0))) - (unless (eql values 0) - ;; Someone wants the value, so copy it. - (output-do-xop segment 'dup)) (etypecase leaf (global-var + (unless (eql values 0) + ;; Someone wants the value, so copy it. + (output-do-xop segment 'dup)) (ecase (global-var-kind leaf) ((:special :global) (output-push-constant segment (global-var-name leaf)) (output-do-inline-function segment 'setf-symbol-value)))) (lambda-var - (output-set-lambda-var segment leaf (node-environment set)))) + (cond ((leaf-refs leaf) + (unless (eql values 0) + ;; Someone wants the value, so copy it. + (output-do-xop segment 'dup)) + (output-set-lambda-var segment leaf (node-environment set))) + ;; If no-one wants the value then pop it else leave it for them. + ((eql values 0) + (output-byte-with-operand segment byte-pop-n 1))))) (unless (eql values 0) (checked-canonicalize-values segment cont 1))) (undefined-value)) -- GitLab