always call Hash#default if no key found; fix #3272

This commit is contained in:
Yukihiro "Matz" Matsumoto
2016-11-24 18:09:04 +09:00
parent 23c73ff399
commit cb5c9d3415
+2 -5
View File
@@ -172,11 +172,8 @@ mrb_hash_get(mrb_state *mrb, mrb_value hash, mrb_value key)
}
/* not found */
if (MRB_RHASH_DEFAULT_P(hash)) {
/* xxx mrb_funcall_tailcall(mrb, hash, "default", 1, key); */
return mrb_funcall(mrb, hash, "default", 1, key);
}
return mrb_nil_value();
/* xxx mrb_funcall_tailcall(mrb, hash, "default", 1, key); */
return mrb_funcall(mrb, hash, "default", 1, key);
}
MRB_API mrb_value