From cbc51a93beaa34f79da470c92615b17a56dde6ca Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Sun, 10 Apr 2011 17:43:22 -0400 Subject: [PATCH] chased problem down to forgetting setting argcount --- compile.rkt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compile.rkt b/compile.rkt index 256162c..066e618 100644 --- a/compile.rkt +++ b/compile.rkt @@ -842,6 +842,9 @@ linkage after-call)]) (append-instruction-sequences + (make-instruction-sequence `(,(make-AssignImmediateStatement + 'argcount + (make-Const n)))) (compile-compiled-procedure-application (length extended-cenv) (make-Label (StaticallyKnownLam-entry-point static-knowledge)) n @@ -871,7 +874,8 @@ (make-instruction-sequence `(,(make-AssignPrimOpStatement 'val (make-GetCompiledProcedureEntry)))) - (make-instruction-sequence `(,(make-PopEnvironment (make-Const num-slots-to-delete) + (make-instruction-sequence `(,(make-PopEnvironment (make-SubtractArg (make-Const cenv-length-with-args) + (make-Reg 'argcount)) (make-Reg 'argcount)))) (make-instruction-sequence `(;; Assign the proc value of the existing call frame