summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-time/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-08-27 09:42:26 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-10-12 18:20:05 +0900
commit5134031e189e1cdde198e1c09f7b1d22bf2a1ce0 (patch)
treec6f9ad2f670c7aa50690f073a6e756f568cbcf00 /mrbgems/mruby-time/src
parentbefcbd5607a060e5e619cae7333512c8bdde32f6 (diff)
downloadmruby-5134031e189e1cdde198e1c09f7b1d22bf2a1ce0.tar.gz
mruby-5134031e189e1cdde198e1c09f7b1d22bf2a1ce0.zip
Use `mrb_int_value()` instead of `mrb_fixnum_value()`.
Where fixnum overflow can happen.
Diffstat (limited to 'mrbgems/mruby-time/src')
-rw-r--r--mrbgems/mruby-time/src/time.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mrbgems/mruby-time/src/time.c b/mrbgems/mruby-time/src/time.c
index 2af86b14e..f0347f54f 100644
--- a/mrbgems/mruby-time/src/time.c
+++ b/mrbgems/mruby-time/src/time.c
@@ -205,7 +205,7 @@ typedef mrb_float mrb_sec;
#define mrb_sec_value(mrb, sec) mrb_float_value(mrb, sec)
#else
typedef mrb_int mrb_sec;
-#define mrb_sec_value(mrb, sec) mrb_fixnum_value(sec)
+#define mrb_sec_value(mrb, sec) mrb_int_value(mrb, sec)
#endif
#define MRB_TIME_T_UINT (~(time_t)0 > 0)
@@ -585,7 +585,7 @@ mrb_time_minus(mrb_state *mrb, mrb_value self)
mrb_int f;
f = tm->sec - tm2->sec;
if (tm->usec < tm2->usec) f--;
- return mrb_fixnum_value(f);
+ return mrb_int_value(mrb, f);
#endif
}
else {
@@ -873,7 +873,7 @@ mrb_time_to_i(mrb_state *mrb, mrb_value self)
return mrb_float_value(mrb, (mrb_float)tm->sec);
}
#endif
- return mrb_fixnum_value((mrb_int)tm->sec);
+ return mrb_int_value(mrb, (mrb_int)tm->sec);
}
/* 15.2.19.7.26 */