summaryrefslogtreecommitdiff
path: root/compile.c
diff options
authorNobuyoshi Nakada <nobu@ruby-lang.org>2024-05-27 18:20:04 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2024-06-02 09:43:33 +0900
commitcedc7737b6a614de1ee2aaa8d66bbca217d9fa8f (patch)
treed233f4d458594d9d68593b9d9e5e87faf8051c44 /compile.c
parenta7d0a910096fd61bff99efdfd6e4810c0287b61e (diff)
Make interchangeable NODE types aliases
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 3438d6a9fa..2d52e316a3 100644
--- a/compile.c
+++ b/compile.c
@@ -4429,11 +4429,12 @@ static int
compile_dregx(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
{
int cnt;
+ int cflag = (int)RNODE_DREGX(node)->as.nd_cflag;
if (!RNODE_DREGX(node)->nd_next) {
if (!popped) {
VALUE src = rb_node_dregx_string_val(node);
- VALUE match = rb_reg_compile(src, (int)RNODE_DREGX(node)->nd_cflag, NULL, 0);
+ VALUE match = rb_reg_compile(src, cflag, NULL, 0);
ADD_INSN1(ret, node, putobject, match);
RB_OBJ_WRITTEN(iseq, Qundef, match);
}
@@ -4441,7 +4442,7 @@ compile_dregx(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, i
}
CHECK(compile_dstr_fragments(iseq, ret, node, &cnt));
- ADD_INSN2(ret, node, toregexp, INT2FIX(RNODE_DREGX(node)->nd_cflag), INT2FIX(cnt));
+ ADD_INSN2(ret, node, toregexp, INT2FIX(cflag), INT2FIX(cnt));
if (popped) {
ADD_INSN(ret, node, pop);
close