[Bug #21011] nd_value
is NULL in massign
This commit is contained in:
parent
1a06bee027
commit
b81db531b2
Notes:
git
2025-01-08 04:55:38 +00:00
@ -10417,7 +10417,7 @@ compile_shareable_literal_constant(rb_iseq_t *iseq, LINK_ANCHOR *ret, enum rb_pa
|
||||
VALUE lit = Qnil;
|
||||
DECL_ANCHOR(anchor);
|
||||
|
||||
enum node_type type = nd_type(node);
|
||||
enum node_type type = node ? nd_type(node) : NODE_NIL;
|
||||
switch (type) {
|
||||
case NODE_TRUE:
|
||||
*value_p = Qtrue;
|
||||
|
@ -1721,6 +1721,15 @@ x = __ENCODING__
|
||||
end;
|
||||
end
|
||||
|
||||
def test_shareable_constant_value_massign
|
||||
a = eval_separately("#{<<~"begin;"}\n#{<<~'end;'}")
|
||||
begin;
|
||||
# shareable_constant_value: experimental_everything
|
||||
A, = 1
|
||||
end;
|
||||
assert_equal(1, a)
|
||||
end
|
||||
|
||||
def test_if_after_class
|
||||
assert_valid_syntax('module if true; Object end::Kernel; end')
|
||||
assert_valid_syntax('module while true; break Object end::Kernel; end')
|
||||
|
Loading…
x
Reference in New Issue
Block a user