From 5f10bd634fb6ae8f74a4ea730176233b0ca96954 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 23 Mar 2022 15:19:48 -0400 Subject: Add ISEQ_BODY macro Use ISEQ_BODY macro to get the rb_iseq_constant_body of the ISeq. Using this macro will make it easier for us to change the allocation strategy of rb_iseq_constant_body when using Variable Width Allocation. --- ast.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ast.c') diff --git a/ast.c b/ast.c index 0515689a29..42d4126a5b 100644 --- a/ast.c +++ b/ast.c @@ -215,14 +215,14 @@ ast_s_of(rb_execution_context_t *ec, VALUE module, VALUE body, VALUE keep_script iseq = rb_method_iseq(body); } if (iseq) { - node_id = iseq->body->location.node_id; + node_id = ISEQ_BODY(iseq)->location.node_id; } } if (!iseq) { return Qnil; } - lines = iseq->body->variable.script_lines; + lines = ISEQ_BODY(iseq)->variable.script_lines; VALUE path = rb_iseq_path(iseq); int e_option = RSTRING_LEN(path) == 2 && memcmp(RSTRING_PTR(path), "-e", 2) == 0; -- cgit v1.2.3