diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-11 10:36:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-11 10:36:36 +0000 |
commit | 47c82df27ff73c5181f7bd4505b4c98a96f15a0c (patch) | |
tree | 5f7b5ede27e5def92ac7772cef35995d4ffd9cea /compile.c | |
parent | cf781b0871cb8d6b7135fa74d9549ca1cdb2a846 (diff) | |
download | ruby-47c82df27ff73c5181f7bd4505b4c98a96f15a0c.tar.gz |
Share the exception local ID table
[Fix GH-2115]
From: Lourens Naudé <lourens@bearmetal.eu>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -106,6 +106,8 @@ struct iseq_compile_data_ensure_node_stack { struct ensure_range *erange; }; +const ID rb_iseq_shared_exc_local_tbl[] = {idERROR_INFO}; + /** * debug function(macro) interface depend on CPDEBUG * if it is less than 0, runtime option is in effect. @@ -1361,14 +1363,8 @@ iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *const anchor) static int iseq_set_exception_local_table(rb_iseq_t *iseq) { - /* TODO: every id table is same -> share it. - * Current problem is iseq_free(). - */ - ID *ids = (ID *)ALLOC_N(ID, 1); - iseq->body->local_table_size = 1; - ids[0] = idERROR_INFO; - iseq->body->local_table = ids; + iseq->body->local_table = rb_iseq_shared_exc_local_tbl; return COMPILE_OK; } |