summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hash.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hash.c b/hash.c
index 0b1f05a3..4242fd58 100644
--- a/hash.c
+++ b/hash.c
@@ -1380,8 +1380,12 @@ val hash_uni(val hash1, val hash2, val join_func)
if (missingp(join_func)) {
sethash(hout, car(entry), cdr(entry));
} else {
- loc ptr = gethash_l(self, hout, car(entry), nulloc);
- set(ptr, funcall2(join_func, cdr(entry), deref(ptr)));
+ val new_p;
+ loc ptr = gethash_l(self, hout, car(entry), mkcloc(new_p));
+ if (new_p)
+ sethash(hout, car(entry), cdr(entry));
+ else
+ set(ptr, funcall2(join_func, cdr(entry), deref(ptr)));
}
}