Project

General

Profile

Actions

Bug #20339

closed

Parser segfault with ractor comment

Added by kddnewton (Kevin Newton) about 2 months ago. Updated about 1 month ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:117186]

Description

foo(
  # shareable_constant_value: literal
  (C = { bar => baz })
)

Updated by kddnewton (Kevin Newton) about 2 months ago

  • Subject changed from Parser segfault with ractor comment in the middle of a statement to Parser segfault with ractor comment

Sorry, this is actually even simpler:

# shareable_constant_value: literal
C = { bar => baz }
Actions #2

Updated by yui-knk (Kaneko Yuichiro) about 1 month ago

  • Status changed from Open to Closed

Applied in changeset git|8ba4d7d75fd231b61727eb0561eb686c1d67bfd4.


Fix unexpected node bug for shareable_constant_value: literal

[Bug #20339]
[Bug #20341]

const_decl_path changes the value of NODE **dest, LHS of an assignment,
with NODE_LIT created by const_decl_path. shareable_literal_constant calls
const_decl_path via ensure_shareable_node multiple times if RHS of an assignment
is array or hash. This means NODE **dest argument of const_decl_path can be NODE_LIT
from the second time then causes [BUG] unexpected node: NODE_LIT in
rb_node_const_decl_val.
This commit change to not update NODE **dest in const_decl_path to
fix the issue.

Actions

Also available in: Atom PDF

Like0
Like0Like0