self must be the newly created object in initialization block; close #1858

This commit is contained in:
Tomoyuki Sahara
2014-03-19 01:08:46 +09:00
parent 93694fe521
commit 40c18fca77
+1 -1
View File
@@ -382,7 +382,7 @@ mrb_struct_s_def(mrb_state *mrb, mrb_value klass)
}
st = make_struct(mrb, name, rest, struct_class(mrb));
if (!mrb_nil_p(b)) {
mrb_funcall(mrb, b, "call", 1, st);
mrb_yield_internal(mrb, b, 1, &st, st, mrb_class_ptr(klass));
}
return st;