diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-10-03 11:10:09 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-10-03 11:10:09 +0900 |
| commit | 88d14e03d0753cfb123d061f29aaaa8c03aca1e5 (patch) | |
| tree | d1abef4666c6cc2fa03e682beb51d6b73ae98138 /mrbgems/mruby-time/src/time.c | |
| parent | 2b3675bca13e292fc2d1a1734d6ba8a078f8edd5 (diff) | |
| download | mruby-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.c | 2 |
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); } |
