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

parent 4cd4c642
...@@ -969,6 +969,7 @@ mrb_hash_merge(mrb_state *mrb, mrb_value hash1, mrb_value hash2) ...@@ -969,6 +969,7 @@ mrb_hash_merge(mrb_state *mrb, mrb_value hash1, mrb_value hash2)
h1 = RHASH_TBL(hash1); h1 = RHASH_TBL(hash1);
h2 = RHASH_TBL(hash2); h2 = RHASH_TBL(hash2);
if (!h2) return;
if (!h1) { if (!h1) {
RHASH_TBL(hash1) = kh_copy(ht, mrb, h2); RHASH_TBL(hash1) = kh_copy(ht, mrb, h2);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment