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:
parent
1b92d94c88
commit
535ed4d041
2 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue