diff options
author | Camil Staps | 2017-07-29 00:09:54 +0200 |
---|---|---|
committer | Camil Staps | 2017-07-29 00:09:54 +0200 |
commit | 03e2887e46a8b84f73037583945ce80b0682d057 (patch) | |
tree | fb93c51d51a5d53270f10df4b81769f25bc93e82 | |
parent | Add globals on A-stack (diff) |
Fix lazy operators
-rw-r--r-- | Sil/Compile.icl | 2 | ||||
-rw-r--r-- | examples/fib.sil | 4 |
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 { |