diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-08-27 09:42:26 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 18:20:05 +0900 |
| commit | 5134031e189e1cdde198e1c09f7b1d22bf2a1ce0 (patch) | |
| tree | c6f9ad2f670c7aa50690f073a6e756f568cbcf00 /src/vm.c | |
| parent | befcbd5607a060e5e619cae7333512c8bdde32f6 (diff) | |
| download | mruby-5134031e189e1cdde198e1c09f7b1d22bf2a1ce0.tar.gz mruby-5134031e189e1cdde198e1c09f7b1d22bf2a1ce0.zip | |
Use `mrb_int_value()` instead of `mrb_fixnum_value()`.
Where fixnum overflow can happen.
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1082,16 +1082,16 @@ RETRY_TRY_BLOCK: CASE(OP_LOADL, BB) { switch (pool[b].tt) { /* number */ case IREP_TT_INT32: - regs[a] = mrb_fixnum_value((mrb_int)pool[b].u.i32); + regs[a] = mrb_int_value(mrb, (mrb_int)pool[b].u.i32); break; case IREP_TT_INT64: #if defined(MRB_INT64) - regs[a] = mrb_fixnum_value((mrb_int)pool[b].u.i64); + regs[a] = mrb_int_value(mrb, (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); + regs[a] = mrb_int_value(mrb, (mrb_int)pool[b].u.i64); break; } #endif |
