summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-09-06 23:30:32 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-09-06 23:30:32 +0900
commit0b44e802a95101bb7c5849382d669cf6cf4f2680 (patch)
treebdba25fd86d0d090348d30e2dc3b4c0dc8d2d956 /src
parent4cd4c64266e7d9075b09e66c4f7b3546a76120f4 (diff)
downloadmruby-0b44e802a95101bb7c5849382d669cf6cf4f2680.tar.gz
mruby-0b44e802a95101bb7c5849382d669cf6cf4f2680.zip
Need to check if merging hash is empty; fix #4107
Diffstat (limited to 'src')
-rw-r--r--src/hash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/hash.c b/src/hash.c
index 7d81bc343..f6b61f4e1 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -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;