summaryrefslogtreecommitdiffhomepage
path: root/src/state.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-03-12 16:21:32 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-03-12 16:21:32 +0900
commit4ae5ae353564291cdb28108c26382c32242966a8 (patch)
tree6cb495e5c3c59a0c9f46b8e4548f17e7082443d2 /src/state.c
parent84e27d3b519d8fba87c6ffdf318ccadf67d5318f (diff)
downloadmruby-4ae5ae353564291cdb28108c26382c32242966a8.tar.gz
mruby-4ae5ae353564291cdb28108c26382c32242966a8.zip
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`).
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c3
1 files changed, 2 insertions, 1 deletions
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; i<irep->plen; 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);
}
}