diff --git a/CHANGELOG.md b/CHANGELOG.md index 9109144c..6f745c02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,8 @@ Bug Fixes - Improved macro hygiene support to properly rename temporary variables in the `let-values` macro. - Improve output of `error` by outputting objects as they are represented in memory by using `write`. - Check for duplicate lambda parameters during compilation. -- Fixd an error that was being raised when calling `(random-source-randomize! default-random-source)`. +- Fixed an error that was being raised when calling `(random-source-randomize! default-random-source)`. +- Raise an error if `list->string` encounters a list element that is not a character. # 0.2 - September 7, 2016 diff --git a/runtime.c b/runtime.c index 517d0073..b378ad96 100644 --- a/runtime.c +++ b/runtime.c @@ -1491,6 +1491,9 @@ object Cyc_list2string(void *data, object cont, object lst) len = Cyc_length(data, lst); // Inefficient, walks whole list buf = alloca(sizeof(char) * (obj_obj2int(len) + 1)); while ((lst != NULL)) { + if (!obj_is_char(car(lst))) { + Cyc_rt_raise2(data, "Expected character but received", car(lst)); + } buf[i++] = obj_obj2char(car(lst)); lst = cdr(lst); }