Should use mrb_int for any object

o=Object.new
def o.to_int
  1
end
p "%*d" % [o, 1]
This commit is contained in:
ksss
2017-03-18 22:04:28 +09:00
parent fa502b498e
commit 2005bf997f
+1 -1
View File
@@ -221,7 +221,7 @@ check_name_arg(mrb_state *mrb, int posarg, const char *name, int len)
tmp_v = GETNEXTARG(); \
p = t; \
} \
num = mrb_fixnum(tmp_v); \
num = mrb_int(mrb, tmp_v); \
} while (0)
static mrb_value