diff --git a/src/new-cmp/cmpbackend.lsp b/src/new-cmp/cmpbackend.lsp index c2ef15784..5ede61ead 100644 --- a/src/new-cmp/cmpbackend.lsp +++ b/src/new-cmp/cmpbackend.lsp @@ -263,13 +263,18 @@ (defun c2varargs-rest-op (dest-loc nargs-loc varargs-loc nkeys keywords-loc allow-other-keys) (if (not (or keywords-loc allow-other-keys)) + ;; Simple case: we do not need to parse keyword arguments, just + ;; collect all &rest (set-loc (if (simple-varargs-loc-p varargs-loc) '(c-inline (:object) "cl_grab_rest_args(args)" () t nil) '(c-inline (:object) "cl_grab_rest_args(cl_args)" () t nil)) dest-loc) + ;; More complicated case: we may need to parse keyword arguments, + ;; collect all remaining arguments in &rest and check or not for + ;; the presence of unknown keywords. (progn (if keywords-loc - (wt-nl "cl_parse_key(cl_args," nkeys "," keywords-loc ",keyvars") + (wt-nl "cl_parse_key(cl_args," nkeys ",&(" keywords-loc "),keyvars") (wt-nl "cl_parse_key(cl_args,0,NULL,NULL")) (if (and dest-loc (not (eq dest-loc 'TRASH))) (wt ",(cl_object*)&" dest-loc)