Need to check if merging hash is empty; fix #4107

This commit is contained in:
Yukihiro "Matz" Matsumoto
2018-09-06 23:30:32 +09:00
parent 4cd4c64266
commit 0b44e802a9
+1
View File
@@ -969,6 +969,7 @@ mrb_hash_merge(mrb_state *mrb, mrb_value hash1, mrb_value hash2)
h1 = RHASH_TBL(hash1);
h2 = RHASH_TBL(hash2);
if (!h2) return;
if (!h1) {
RHASH_TBL(hash1) = kh_copy(ht, mrb, h2);
return;