core: length: Check parameter.
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 30 Apr 2018 17:31:00 +0000 (19:31 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 30 Apr 2018 17:31:00 +0000 (19:31 +0200)
* src/mes.c (length): Check parameter.

src/mes.c

index 4f787929a016363ad02b7bb303716abc882b8119..8bd705614aecf5e9ba1f637e429af9bf67825bc7 100644 (file)
--- a/src/mes.c
+++ b/src/mes.c
@@ -520,6 +520,8 @@ length__ (SCM x) ///((internal))
 SCM
 length (SCM x)
 {
+  if (x != cell_nil && TYPE (x) != TPAIR)
+    error (cell_symbol_not_a_pair, x);
   return MAKE_NUMBER (length__ (x));
 }