summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2021-04-27 15:31:19 +0900
committerYusuke Endoh <mame@ruby-lang.org>2021-04-27 17:05:19 +0900
commite48109d86fa06584a79610ecd5cb16f0bbd64e8c (patch)
treec9da0f12ca1f6b93ff2d8f24d26d9bd986aa5fab
parentede26169904a5fbca2e4fd8484dbf80db431f5a7 (diff)
downloadruby-e48109d86fa06584a79610ecd5cb16f0bbd64e8c.tar.gz
Partially revert 2c7d3b3a722c4636ab1e9d289cbca47ddd168d3e
to make imemo_ast WB-protected again. Only the test is kept.
-rw-r--r--gc.c7
-rw-r--r--internal/imemo.h1
-rw-r--r--node.c2
3 files changed, 1 insertions, 9 deletions
diff --git a/gc.c b/gc.c
index c7e9754ab6..4d78b85543 100644
--- a/gc.c
+++ b/gc.c
@@ -2435,13 +2435,6 @@ rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0)
return newobj_of(v0, flags, v1, v2, v3, TRUE);
}
-rb_ast_t *
-rb_imemo_ast_new(VALUE node_buffer)
-{
- VALUE flags = T_IMEMO | (imemo_ast << FL_USHIFT);
- return (rb_ast_t *)newobj_of(node_buffer, flags, 0, 0, 0, FALSE);
-}
-
static VALUE
rb_imemo_tmpbuf_new(VALUE v1, VALUE v2, VALUE v3, VALUE v0)
{
diff --git a/internal/imemo.h b/internal/imemo.h
index 102356c78c..a9e2136ac4 100644
--- a/internal/imemo.h
+++ b/internal/imemo.h
@@ -130,7 +130,6 @@ 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);
diff --git a/node.c b/node.c
index 2392d5b8d1..bef9d7bcbd 100644
--- a/node.c
+++ b/node.c
@@ -1299,7 +1299,7 @@ rb_ast_t *
rb_ast_new(void)
{
node_buffer_t *nb = rb_node_buffer_new();
- rb_ast_t *ast = rb_imemo_ast_new((VALUE)nb);
+ rb_ast_t *ast = (rb_ast_t *)rb_imemo_new(imemo_ast, 0, 0, 0, (VALUE)nb);
return ast;
}