summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2020-01-12 21:05:19 +0100
committerAndy Wingo <wingo@pobox.com>2020-01-12 21:05:19 +0100
commitaa0bfa2f9387262ad972674c4d1d88e0e3d863b3 (patch)
tree738613bde4baab0ff1aa59452236e687b2a05dbd /module
parentfb7b873afa29f707d74c47ac41153b18cf165737 (diff)
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.scm4
1 files changed, 2 insertions, 2 deletions
diff --git a/module/language/tree-il/peval.scm b/module/language/tree-il/peval.scm
index 13b7d9bc4..c9db7bea1 100644
--- a/module/language/tree-il/peval.scm
+++ b/module/language/tree-il/peval.scm
@@ -1,6 +1,6 @@
;;; Tree-IL partial evaluator
-;; Copyright (C) 2011-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2014, 2020 Free Software Foundation, Inc.
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -1480,7 +1480,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?)