Skip to content

Commit 837f62f

Browse files
committed
hash.c: should check type before setting default_proc; fix mruby#6483
1 parent fbaedfe commit 837f62f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/hash.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,6 +1477,7 @@ mrb_hash_set_default_proc(mrb_state *mrb, mrb_value hash)
14771477
mrb_value ifnone = mrb_get_arg1(mrb);
14781478

14791479
hash_modify(mrb, hash);
1480+
mrb_check_type(mrb, ifnone, MRB_TT_PROC);
14801481
mrb_iv_set(mrb, hash, MRB_SYM(ifnone), ifnone);
14811482
if (!mrb_nil_p(ifnone)) {
14821483
RHASH(hash)->flags |= MRB_HASH_PROC_DEFAULT;

0 commit comments

Comments
 (0)