mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 14:00:21 +02:00
fix for (apply values '(1))
* libguile/vm-i-system.c (return/values): In the multiple-values-to-a-single-value-continuation (or MV but where N=1), null out the correct number of values from the stack. Fixes aborts on (apply values '(1)). * testsuite/t-values.scm (call-with-values): Add a test.
This commit is contained in:
parent
42906d7406
commit
9b10d0bcfd
2 changed files with 5 additions and 1 deletions
|
@ -1069,7 +1069,7 @@ VM_DEFINE_INSTRUCTION (return_values, "return/values", 1, -1, -1)
|
|||
*++sp = stack_base[1];
|
||||
|
||||
/* Finally set new stack_base */
|
||||
NULLSTACK (stack_base - sp);
|
||||
NULLSTACK (stack_base - sp + nvalues + 1);
|
||||
stack_base = SCM_FRAME_UPPER_ADDRESS (fp) - 1;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -5,5 +5,9 @@
|
|||
;; the start-stack forces a bounce through the interpreter
|
||||
(call-with-values
|
||||
(lambda () (start-stack 'foo (values 1 2)))
|
||||
list)
|
||||
|
||||
(call-with-values
|
||||
(lambda () (apply values '(1)))
|
||||
list))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue