core: length: Check parameter.

* src/mes.c (length): Check parameter.
This commit is contained in:
Jan Nieuwenhuizen 2018-04-30 19:31:00 +02:00
parent 98417537a2
commit ec85612ac4
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 2 additions and 0 deletions

View File

@ -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));
}