summaryrefslogtreecommitdiff
path: root/test-suite
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 /test-suite
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 'test-suite')
-rw-r--r--test-suite/tests/peval.test21
1 files changed, 19 insertions, 2 deletions
diff --git a/test-suite/tests/peval.test b/test-suite/tests/peval.test
index 4e2ccf9c6..82cf335cc 100644
--- a/test-suite/tests/peval.test
+++ b/test-suite/tests/peval.test
@@ -1,7 +1,7 @@
;;;; tree-il.test --- test suite for compiling tree-il -*- scheme -*-
;;;; Andy Wingo <wingo@pobox.com> --- May 2009
;;;;
-;;;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;;;; Copyright (C) 2009-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
@@ -1413,4 +1413,21 @@
(call (lexical lp _)
(lexical x* _))))))))
(call (lexical lp _)
- (lexical x _))))))))
+ (lexical x _)))))))
+
+ (pass-if-peval
+ (lambda ()
+ (define (add1 n) (+ 1 n))
+ (add1 1 2))
+ (lambda ()
+ (lambda-case
+ ((() #f #f #f () ())
+ (letrec* (add1)
+ (_)
+ ((lambda ((name . add1))
+ (lambda-case
+ (((n) #f #f #f () (_))
+ (primcall + (const 1) (lexical n _))))))
+ (call (lexical add1 _)
+ (const 1)
+ (const 2))))))))