aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Sil/Compile.icl2
-rw-r--r--examples/fib.sil4
2 files changed, 3 insertions, 3 deletions
diff --git a/Sil/Compile.icl b/Sil/Compile.icl
index 0d5a3f2..fab7643 100644
--- a/Sil/Compile.icl
+++ b/Sil/Compile.icl
@@ -508,6 +508,7 @@ where
storeStackOffsets *>
gen e1 *>
tell [ 'ABC'.JmpTrue true ] *>
+ shrinkStack {zero & bsize=1} *>
gen e2 *>
tell [ 'ABC'.Jmp end ] *>
restoreStackOffsets *>
@@ -523,6 +524,7 @@ where
storeStackOffsets *>
gen e1 *>
tell [ 'ABC'.JmpFalse false ] *>
+ shrinkStack {zero & bsize=1} *>
gen e2 *>
tell [ 'ABC'.Jmp end ] *>
restoreStackOffsets *>
diff --git a/examples/fib.sil b/examples/fib.sil
index 4a218ed..23cf295 100644
--- a/examples/fib.sil
+++ b/examples/fib.sil
@@ -3,9 +3,7 @@
*/
Int fib(Int n) {
// Base cases
- if (n == 1) {
- return 1;
- } else if (n == 2) {
+ if (n == 1 || n == 2) {
return 1;
// Recursive case
} else {