From 9bd8fabc9f45dbdb7c66c44f255904ab62df4ee3 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 16 Dec 2015 06:14:10 -0800 Subject: bugfix: dwim_set not handling hash correctly. * lib.c (dwim_set): When the range argument is a vector or list, it is wrongly hangled through replace, even if seq is a hash. replace throws since it doesn't handle hashes. We must treat the vector or list as a hash key and handle through sethash. --- lib.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib.c') diff --git a/lib.c b/lib.c index 14a2b65a..6041a11e 100644 --- a/lib.c +++ b/lib.c @@ -7625,6 +7625,10 @@ val dwim_set(val seq, val ind_range, val newval) case CONS: case LCONS: case VEC: + if (hashp(seq)) { + (void) sethash(seq, ind_range, newval); + return seq; + } return replace(seq, newval, ind_range, colon_k); case RNG: if (!hashp(seq)) -- cgit v1.2.3