diff --git a/src/CHANGELOG b/src/CHANGELOG index 545adac57..e558527e4 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -7,6 +7,8 @@ ECL 0.9h high level routines (VECTOR-PUSH-EXTEND) to handle the vector of weak pointers to the files. + - MULTIPLE-VALUE-SETQ must output only the primary value. + * Design: - Simplified the structure of the frame stack, removing redundant fields. diff --git a/src/c/compiler.d b/src/c/compiler.d index 045e49269..f60d15d0d 100644 --- a/src/c/compiler.d +++ b/src/c/compiler.d @@ -1368,7 +1368,7 @@ static int c_multiple_value_setq(cl_object orig_args, int flags) { cl_object args = orig_args; cl_object orig_vars; - cl_object vars = Cnil; + cl_object vars = Cnil, values; cl_object old_variables = ENV->variables; cl_index nvars = 0; @@ -1394,12 +1394,14 @@ c_multiple_value_setq(cl_object orig_args, int flags) { } /* Compile values */ - compile_form(pop(&args), FLAG_VALUES); + values = pop(&args); if (args != Cnil) FEprogram_error("MULTIPLE-VALUE-SETQ: Too many arguments.", 0); - if (nvars == 0) + if (nvars == 0) { /* No variables */ - return flags; + return compile_form(cl_list(2, @'values', values), flags); + } + compile_form(values, FLAG_VALUES); /* Compile variables */ asm_op2(OP_MSETQ, nvars); diff --git a/src/c/interpreter.d b/src/c/interpreter.d index d7929943a..1ec082100 100644 --- a/src/c/interpreter.d +++ b/src/c/interpreter.d @@ -540,7 +540,10 @@ interpret_msetq(cl_object bytecodes, cl_opcode *vector) ECL_SETQ(name, value); } } - if (NVALUES > 1) NVALUES = 1; + if (NVALUES == 0) { + VALUES(0) = Cnil; + } + NVALUES = 1; return vector; }