summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2020-01-12 21:11:09 +0100
committerAndy Wingo <wingo@pobox.com>2020-01-12 21:11:09 +0100
commitcf53854d42d4e260459896cb0c4b071608398b96 (patch)
tree9205a9d57ce3055cd55ee664e3d291b55a0cb3b1 /module
parentfd2ffc649c2d08639c2ac41c25e4ebdbeb4b151d (diff)
downloadguile-cf53854d42d4e260459896cb0c4b071608398b96.tar.gz
Fix peval bug that ignored excess args
* module/language/tree-il/peval.scm (peval): Fix arity check for type confusion (empty value of "rest" in this context was (), not #f). The effect was that we'd silently allow extra arguments to inlined calls. Thanks to Christopher Lam for the report! Fixes #38617. * test-suite/tests/peval.test ("partial evaluation"): Add a test.
Diffstat (limited to 'module')
-rw-r--r--module/language/tree-il/peval.scm2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/language/tree-il/peval.scm b/module/language/tree-il/peval.scm
index f11640fa5..b400c71a7 100644
--- a/module/language/tree-il/peval.scm
+++ b/module/language/tree-il/peval.scm
@@ -1457,7 +1457,7 @@ top-level bindings from ENV and return the resulting expression."
opt-vals)))))
(cond
- ((or (< nargs nreq) (and (not rest) (> nargs (+ nreq nopt))))
+ ((or (< nargs nreq) (and (null? rest) (> nargs (+ nreq nopt))))
;; An error, or effecting arguments.
(make-call src (for-call orig-proc) (map for-value orig-args)))
((or (and=> (find-counter key counter) counter-recursive?)