diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-07-20 13:33:13 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:21:23 +0900 |
| commit | 8b3f3c0bf3551c4808ce2e9ab58fcca480e0ab9c (patch) | |
| tree | 0189545db956f3c19e74353aaa88f23a61257c8a /src/vm.c | |
| parent | cf2aabdad6922eca1317f8541672e6176fc4c7b5 (diff) | |
| download | mruby-8b3f3c0bf3551c4808ce2e9ab58fcca480e0ab9c.tar.gz mruby-8b3f3c0bf3551c4808ce2e9ab58fcca480e0ab9c.zip | |
Fix the bug by the combination with `MRB_64BIT` and `MRB_INT32`.
Which is caused by `MRB_NAN_BOXING`.
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1018,10 +1018,16 @@ RETRY_TRY_BLOCK: regs[a] = mrb_fixnum_value((mrb_int)pool[b].u.i32); break; case IREP_TT_INT64: -#if defined(MRB_INT64) && defined(MRB_64BIT) +#if defined(MRB_INT64) regs[a] = mrb_fixnum_value((mrb_int)pool[b].u.i64); break; #else +#if defined(MRB_64BIT) + if (INT32_MIN <= pool[b].u.i64 && pool[b].u.i64 <= INT32_MAX) { + regs[a] = mrb_fixnum_value((mrb_int)pool[b].u.i64); + break; + } +#endif { mrb_value exc = mrb_exc_new_str_lit(mrb, E_RUNTIME_ERROR, "integer overflow"); mrb_exc_set(mrb, exc); |
