summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-time/src/time.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-10-03 11:10:09 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-10-03 11:10:09 +0900
commit88d14e03d0753cfb123d061f29aaaa8c03aca1e5 (patch)
treed1abef4666c6cc2fa03e682beb51d6b73ae98138 /mrbgems/mruby-time/src/time.c
parent2b3675bca13e292fc2d1a1734d6ba8a078f8edd5 (diff)
downloadmruby-88d14e03d0753cfb123d061f29aaaa8c03aca1e5.tar.gz
mruby-88d14e03d0753cfb123d061f29aaaa8c03aca1e5.zip
time_t may overflow mrb_int when word boxing is used
Diffstat (limited to 'mrbgems/mruby-time/src/time.c')
-rw-r--r--mrbgems/mruby-time/src/time.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-time/src/time.c b/mrbgems/mruby-time/src/time.c
index 00c8387b2..5f60eef4d 100644
--- a/mrbgems/mruby-time/src/time.c
+++ b/mrbgems/mruby-time/src/time.c
@@ -671,7 +671,7 @@ mrb_time_to_i(mrb_state *mrb, mrb_value self)
struct mrb_time *tm;
tm = DATA_GET_PTR(mrb, self, &mrb_time_type, struct mrb_time);
-#ifdef MRB_INT16
+#if defined(MRB_INT16) || defined(MRB_WORD_BOXING)
if (tm->sec > MRB_INT_MAX || tm->sec < MRB_INT_MIN) {
return mrb_float_value(mrb, (mrb_float)tm->sec);
}