summaryrefslogtreecommitdiffhomepage
path: root/src/vm.c
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 /src/vm.c
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 'src/vm.c')
-rw-r--r--src/vm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vm.c b/src/vm.c
index 540ba7681..52895bd28 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -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