summaryrefslogtreecommitdiffhomepage
path: root/src/vm.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-06-15 08:55:48 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-10-12 16:21:11 +0900
commitee111dd175f3242649d87a4600e2bad62e8e0940 (patch)
treecabfe4a193075d9110ea3608e8dc4c3bb835e280 /src/vm.c
parentf0c11269977e83f2e578a32134d4b65a2cf72ec0 (diff)
downloadmruby-ee111dd175f3242649d87a4600e2bad62e8e0940.tar.gz
mruby-ee111dd175f3242649d87a4600e2bad62e8e0940.zip
Clarify the use of `MRB_64BIT` and `MRB_INT64` in `dump.c` and `load.c`.
- `MRB_64BIT`: the size of a pointer is 64 bits - `MRB_INT64`: the size of `mrb_int` is 64 bits
Diffstat (limited to 'src/vm.c')
-rw-r--r--src/vm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vm.c b/src/vm.c
index 62805b7ed..98f17e287 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -1017,10 +1017,16 @@ RETRY_TRY_BLOCK:
case IREP_TT_INT32:
regs[a] = mrb_fixnum_value((mrb_int)pool[b].u.i32);
break;
-#ifdef MRB_INT64
case IREP_TT_INT64:
+#if defined(MRB_INT64) && defined(MRB_64BIT)
regs[a] = mrb_fixnum_value((mrb_int)pool[b].u.i64);
break;
+#else
+ {
+ mrb_value exc = mrb_exc_new_str_lit(mrb, E_RUNTIME_ERROR, "integer overflow");
+ mrb_exc_set(mrb, exc);
+ }
+ goto L_RAISE;
#endif
#ifndef MRB_WITHOUT_FLOAT
case IREP_TT_FLOAT: