Skip to content

Assertion failed in parse_blocklike_parameters parsing a{|1|.=it} #3740

@tompng

Description

@tompng
% ruby -Ilib -rprism -e "Prism.parse 'a{|1|.=it}'"
Assertion failed: (false && "unreachable"), function parse_blocklike_parameters, file prism.c, line 15465.
zsh: abort      ruby -Ilib -rprism -e "Prism.parse 'a{|1|.=it}'"

Looks like implicit_parameters->nodes[0]->type is changed after pm_node_destroy is called at

prism/src/prism.c

Lines 13847 to 13852 in ec4178b

// If there are arguments on the call node, then it can't be a method
// call ending with = or a local variable write, so it must be a
// syntax error. In this case we'll fall through to our default
// handling. We need to free the value that we parsed because there
// is no way for us to attach it to the tree at this point.
pm_node_destroy(parser, value);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions