summaryrefslogtreecommitdiff
path: root/internal/imemo.h
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2021-04-26 18:11:46 +0900
committerYusuke Endoh <mame@ruby-lang.org>2021-04-26 22:46:51 +0900
commit2c7d3b3a722c4636ab1e9d289cbca47ddd168d3e (patch)
treecb21ba7bca3f68e93587d3e75e07990c443c9a51 /internal/imemo.h
parent5219b4ddb4b89dfe8a951da75f5ab78431781d7f (diff)
downloadruby-2c7d3b3a722c4636ab1e9d289cbca47ddd168d3e.tar.gz
node.c (rb_ast_new): imemo_ast is WB-unprotected
Previously imemo_ast was handled as WB-protected which caused a segfault of the following code: # shareable_constant_value: literal M0 = {} M1 = {} ... M100000 = {} My analysis is here: `shareable_constant_value: literal` creates many Hash instances during parsing, and add them to node_buffer of imemo_ast. However, the contents are missed because imemo_ast is incorrectly WB-protected. This changeset makes imemo_ast as WB-unprotected.
Diffstat (limited to 'internal/imemo.h')
-rw-r--r--internal/imemo.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/imemo.h b/internal/imemo.h
index a9e2136ac4..102356c78c 100644
--- a/internal/imemo.h
+++ b/internal/imemo.h
@@ -130,6 +130,7 @@ struct MEMO {
typedef struct rb_imemo_tmpbuf_struct rb_imemo_tmpbuf_t;
VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0);
+struct rb_ast_struct *rb_imemo_ast_new(VALUE node_buffer);
rb_imemo_tmpbuf_t *rb_imemo_tmpbuf_parser_heap(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt);
struct vm_ifunc *rb_vm_ifunc_new(rb_block_call_func_t func, const void *data, int min_argc, int max_argc);
void rb_strterm_mark(VALUE obj);