From 9e637d1f9d27be47d9c9fffe4539f955d86b394f Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Wed, 7 Mar 2012 14:28:05 -0700 Subject: [PATCH] svm: Save a byte encoding (ea:stack-ref 0). --- src/compiler/machines/svm/machine.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler/machines/svm/machine.scm b/src/compiler/machines/svm/machine.scm index 146070529..976d1054b 100644 --- a/src/compiler/machines/svm/machine.scm +++ b/src/compiler/machines/svm/machine.scm @@ -222,7 +222,10 @@ USA. (ea:pre-decrement rref:stack-pointer 'WORD)) (define (ea:stack-ref index) - (ea:offset rref:stack-pointer index 'WORD)) + (guarantee-non-negative-fixnum index 'ea:stack-ref) + (if (zero? index) + (ea:indirect rref:stack-pointer) + (ea:offset rref:stack-pointer index 'WORD))) (define (ea:alloc-word) (ea:post-increment rref:free-pointer 'WORD)) -- 2.25.1