Fix bug in calling sequence of known lexprs: when callee needs a
authorChris Hanson <org/chris-hanson/cph>
Fri, 16 Jun 1989 09:14:08 +0000 (09:14 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 16 Jun 1989 09:14:08 +0000 (09:14 +0000)
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

index f3362f999651afaef811820d75f0790fd1b20432..8be2ca63e935a4aa1953e79954cf91d7ee4ae35a 100644 (file)
@@ -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