From 46626d8c87fbbf7dbd146902fa4a0785aa853b38 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 16 Jun 1989 09:14:08 +0000 Subject: [PATCH] Fix bug in calling sequence of known lexprs: when callee needs a static link, the number of arguments pushed is one less than the frame size. Previously this case was not being handled specially, and the resulting code worked only because the compiled code interface had a bug which caused the wrong number of arguments to be popped. --- v7/src/compiler/rtlgen/rgcomb.scm | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/v7/src/compiler/rtlgen/rgcomb.scm b/v7/src/compiler/rtlgen/rgcomb.scm index f3362f999..8be2ca63e 100644 --- a/v7/src/compiler/rtlgen/rgcomb.scm +++ b/v7/src/compiler/rtlgen/rgcomb.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlgen/rgcomb.scm,v 4.10 1989/05/31 20:02:11 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlgen/rgcomb.scm,v 4.11 1989/06/16 09:14:08 cph Rel $ -Copyright (c) 1988 Massachusetts Institute of Technology +Copyright (c) 1988, 1989 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -90,12 +90,17 @@ MIT in each case. |# (generate/procedure-entry/inline callee)) (else (enqueue-procedure! callee) - ((if (procedure-rest callee) - rtl:make-invocation:lexpr - rtl:make-invocation:jump) - frame-size - continuation - (procedure-label callee))))))) + (if (procedure-rest callee) + (rtl:make-invocation:lexpr + (if (stack-block/static-link? (procedure-block callee)) + (-1+ frame-size) + frame-size) + continuation + (procedure-label callee)) + (rtl:make-invocation:jump + frame-size + continuation + (procedure-label callee)))))))) (define (invocation/apply model operator frame-size continuation prefix) model operator ; ignored -- 2.25.1