1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 03:30:27 +02:00

fix *another* bug in compiling `or'. incredible.

* module/system/il/compile.scm (codegen): Fix *another* bug in compiling
  `or' -- in the case in which the value was being discarded, as in `or'
  used as a control structure, we were sometimes leaving a value on the
  stack.

* testsuite/t-or.scm: Add another test case for `or'.
This commit is contained in:
Andy Wingo 2008-09-13 14:13:13 +02:00
parent 1b92d94c88
commit 535ed4d041
2 changed files with 6 additions and 2 deletions

View file

@ -262,9 +262,11 @@
(maybe-return))
(else
(comp-push (car exps))
(push-call! #f 'dup '())
(if (not drop)
(push-call! #f 'dup '()))
(push-branch! #f 'br-if L1)
(push-call! #f 'drop '())
(if (not drop)
(push-call! #f 'drop '()))
(lp (cdr exps)))))))))
((<ghil-begin> env loc exps)

View file

@ -10,6 +10,8 @@
(or #f 'where)
(or #f #f)
(or 'what #f)
;; not in tail position, value discarded
(begin (or 'what (error "two")) 'two)
;; in tail position (within the lambdas)
((lambda ()
(or)))