aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilipp Stephani2017-01-18 19:49:58 +0100
committerPhilipp Stephani2017-01-19 17:17:50 +0100
commit9c4e3097b595c739bb29261759b9ba631431329e (patch)
treec1b3bf8f62a29dd9289fea6f7342b7765b3d70a8 /src
parent8c0fcaf66733f0538a3f024f383cb34a3c93d73c (diff)
downloademacs-9c4e3097b595c739bb29261759b9ba631431329e.tar.gz
emacs-9c4e3097b595c739bb29261759b9ba631431329e.zip
Check that variable lists are actually lists
'let' and 'let*' document that their first argument has to be a list, but don't check for that; instead, they allow (and silently ignore) other types. Introduce an explicit type check. * src/eval.c (Flet, FletX): Check that the variable list is indeed a list. * test/src/eval-tests.el: Add unit tests.
Diffstat (limited to 'src')
-rw-r--r--src/eval.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index 1f8d4099324..c05c8d8f8de 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -857,6 +857,7 @@ usage: (let* VARLIST BODY...) */)
857 lexenv = Vinternal_interpreter_environment; 857 lexenv = Vinternal_interpreter_environment;
858 858
859 varlist = XCAR (args); 859 varlist = XCAR (args);
860 CHECK_LIST (varlist);
860 while (CONSP (varlist)) 861 while (CONSP (varlist))
861 { 862 {
862 QUIT; 863 QUIT;
@@ -917,6 +918,7 @@ usage: (let VARLIST BODY...) */)
917 USE_SAFE_ALLOCA; 918 USE_SAFE_ALLOCA;
918 919
919 varlist = XCAR (args); 920 varlist = XCAR (args);
921 CHECK_LIST (varlist);
920 922
921 /* Make space to hold the values to give the bound variables. */ 923 /* Make space to hold the values to give the bound variables. */
922 elt = Flength (varlist); 924 elt = Flength (varlist);