PR #2521 did not work for singleton classes for non-class objects; fix #3003

This commit is contained in:
Yukihiro "Matz" Matsumoto
2015-11-07 15:51:00 +09:00
parent 8bad1954a4
commit d3b323cf2f
2 changed files with 26 additions and 15 deletions
-9
View File
@@ -2208,15 +2208,6 @@ RETRY_TRY_BLOCK:
}
else {
p = mrb_proc_new(mrb, irep->reps[GETARG_b(i)]);
if (c & OP_L_METHOD) {
if (p->target_class->tt == MRB_TT_SCLASS) {
mrb_value klass;
klass = mrb_obj_iv_get(mrb,
(struct RObject *)p->target_class,
mrb_intern_lit(mrb, "__attached__"));
p->target_class = mrb_class_ptr(klass);
}
}
}
if (c & OP_L_STRICT) p->flags |= MRB_PROC_STRICT;
regs[GETARG_A(i)] = mrb_obj_value(p);