diff options
author | Andy Wingo <wingo@pobox.com> | 2020-01-12 21:11:09 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2020-01-12 21:11:09 +0100 |
commit | cf53854d42d4e260459896cb0c4b071608398b96 (patch) | |
tree | 9205a9d57ce3055cd55ee664e3d291b55a0cb3b1 /test-suite/tests/peval.test | |
parent | fd2ffc649c2d08639c2ac41c25e4ebdbeb4b151d (diff) | |
download | guile-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 'test-suite/tests/peval.test')
-rw-r--r-- | test-suite/tests/peval.test | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/test-suite/tests/peval.test b/test-suite/tests/peval.test index 22b78f66f..2eecc8218 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, 2017 Free Software Foundation, Inc. +;;;; Copyright (C) 2009-2014, 2017, 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 @@ -1415,4 +1415,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 () ()) + (fix (add1) + (_) + ((lambda ((name . add1)) + (lambda-case + (((n) #f #f #f () (_)) + (primcall + (const 1) (lexical n _)))))) + (call (lexical add1 _) + (const 1) + (const 2)))))))) |