From 4ae5ae353564291cdb28108c26382c32242966a8 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 12 Mar 2021 16:21:32 +0900 Subject: codegen.c: no integer overflow error in `codegen`; close #5376 Add new pool value type `IREP_TT_BIGINT` and generate integer overflow error in the VM. In the future, `mruby` will support `Bignum` for integers bigger than `mrb_int` (probably using `mpz`). --- src/state.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/state.c') diff --git a/src/state.c b/src/state.c index 0ba6db6ce..1b50eec34 100644 --- a/src/state.c +++ b/src/state.c @@ -154,7 +154,8 @@ mrb_irep_free(mrb_state *mrb, mrb_irep *irep) mrb_free(mrb, (void*)irep->iseq); if (irep->pool) { for (i=0; iplen; i++) { - if ((irep->pool[i].tt & 3) == IREP_TT_STR) { + if ((irep->pool[i].tt & 3) == IREP_TT_STR || + irep->pool[i].tt == IREP_TT_BIGINT) { mrb_free(mrb, (void*)irep->pool[i].u.str); } } -- cgit v1.2.3