Commit d82fc884 authored by Tomoyuki Sahara's avatar Tomoyuki Sahara

set DATA_TYPE as soon as possible.

parent c9f3fd47
......@@ -528,6 +528,8 @@ mrb_time_initialize(mrb_state *mrb, mrb_value self)
if (tm) {
mrb_time_free(mrb, tm);
}
DATA_TYPE(self) = &mrb_time_type;
DATA_PTR(self) = NULL;
n = mrb_get_args(mrb, "|iiiiiii",
&ayear, &amonth, &aday, &ahour, &amin, &asec, &ausec);
......@@ -538,7 +540,6 @@ mrb_time_initialize(mrb_state *mrb, mrb_value self)
tm = time_mktime(mrb, ayear, amonth, aday, ahour, amin, asec, ausec, MRB_TIMEZONE_LOCAL);
}
DATA_PTR(self) = tm;
DATA_TYPE(self) = &mrb_time_type;
return self;
}
......
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