From ee111dd175f3242649d87a4600e2bad62e8e0940 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 15 Jun 2020 08:55:48 +0900 Subject: 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 --- src/vm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/vm.c') 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: -- cgit v1.2.3