diff --git a/prism_compile.c b/prism_compile.c index 6880f46b69..eab1a2d7ea 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -2688,6 +2688,7 @@ pm_compile_defined_expr0(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *co return; case PM_CALL_AND_WRITE_NODE: case PM_CALL_OPERATOR_WRITE_NODE: + case PM_CALL_OR_WRITE_NODE: case PM_CONSTANT_WRITE_NODE: case PM_CONSTANT_OPERATOR_WRITE_NODE: diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index ba8178674f..df6a27a666 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -240,6 +240,7 @@ module Prism assert_prism_eval("defined?(PrismTestSubclass.test_call_and_write_node &&= 1)") assert_prism_eval("defined?(PrismTestSubclass.test_call_operator_write_node += 1)") + assert_prism_eval("defined?(PrismTestSubclass.test_call_or_write_node ||= 1)") end def test_GlobalVariableReadNode