summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorJeremy Evans <[email protected]>2024-01-10 13:07:34 -0800
committerJeremy Evans <[email protected]>2024-01-10 16:02:38 -0800
commitef751252711ca7ecabb3e4ad9214fa0d1d63608a (patch)
treed9c62a3c8ca06c2b9c983b7b49e24ee6d849ac60 /compile.c
parent25f5b83689fc6dd137d45b634a0cd6e8bd024728 (diff)
Make defined? for op asgn expressions to constants use "assignment"
Previously, it used "expression", as that was the default. However, op asgn expressions to constants use the NODE_OP_CDECL, so recognize that node type as assignement. Fixes [Bug #20111]
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index 3822646c0e..6e0456af35 100644
--- a/compile.c
+++ b/compile.c
@@ -5951,6 +5951,7 @@ defined_expr0(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
case NODE_IASGN:
case NODE_CDECL:
case NODE_CVASGN:
+ case NODE_OP_CDECL:
expr_type = DEFINED_ASGN;
break;
}