diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-06-24 17:21:19 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-06-24 17:21:19 -0700 |
commit | b41ee52db4b65877208a9100e9f5eb7ecad97359 (patch) | |
tree | 2bae044c4b6d1294a50b3ad2f3d1bb34854b5d5e | |
parent | ff9616f852231dee56948073099368c149b8660b (diff) | |
download | txr-b41ee52db4b65877208a9100e9f5eb7ecad97359.tar.gz txr-b41ee52db4b65877208a9100e9f5eb7ecad97359.tar.bz2 txr-b41ee52db4b65877208a9100e9f5eb7ecad97359.zip |
replace: fix strange diagnostic from bad fallthrough.
* lib.c (replace): If a COBJ is passed to replace which
doesn't support the operation, we wrongly pass it to
replace_buf because the BUF case was added into the
fallthrough pass. The end result is that length_buf blows up
on the object, resulting in a strange diagnostic.
The BUF case must be moved above COBJ.
-rw-r--r-- | lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -10105,14 +10105,14 @@ val replace(val seq, val items, val from, val to) return replace_str(seq, items, from, to); case VEC: return replace_vec(seq, items, from, to); + case BUF: + return replace_buf(seq, items, from, to); case COBJ: if (seq->co.cls == carray_s) return carray_replace(seq, items, from, to); if (obj_struct_p(seq)) return replace_obj(seq, items, from, to); /* fallthrough */ - case BUF: - return replace_buf(seq, items, from, to); default: type_mismatch(lit("~a: ~s is not a sequence"), self, seq, nao); } |