summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-06-24 17:21:19 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-06-24 17:21:19 -0700
commit3ef45acb19c1df4f58b5fb2f2b289f6b8a923fd6 (patch)
tree2bae044c4b6d1294a50b3ad2f3d1bb34854b5d5e /lib.c
parentec6aa3e26fe599d7ce87f7addc2a63b58621eab0 (diff)
downloadtxr-3ef45acb19c1df4f58b5fb2f2b289f6b8a923fd6.tar.gz
txr-3ef45acb19c1df4f58b5fb2f2b289f6b8a923fd6.tar.bz2
txr-3ef45acb19c1df4f58b5fb2f2b289f6b8a923fd6.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.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index 3554e290..746f0e72 100644
--- a/lib.c
+++ b/lib.c
@@ -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);
}