Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 13 additions & 20 deletions prism/prism.c
Original file line number Diff line number Diff line change
Expand Up @@ -13849,6 +13849,18 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod
// 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.
switch (PM_NODE_TYPE(value)) {
case PM_LOCAL_VARIABLE_READ_NODE:
case PM_IT_LOCAL_VARIABLE_READ_NODE:
// Since it is possible for the value to be an implicit
// parameter, we need to remove it from the list of implicit
// parameters.
parse_target_implicit_parameter(parser, value);
break;
default:
break;
}

pm_node_destroy(parser, value);
}
PRISM_FALLTHROUGH
Expand Down Expand Up @@ -14232,25 +14244,6 @@ parse_assocs(pm_parser_t *parser, pm_static_literals_t *literals, pm_node_t *nod
return contains_keyword_splat;
}

static inline bool
argument_allowed_for_bare_hash(pm_parser_t *parser, pm_node_t *argument) {
if (pm_symbol_node_label_p(argument)) {
return true;
}

switch (PM_NODE_TYPE(argument)) {
case PM_CALL_NODE: {
pm_call_node_t *cast = (pm_call_node_t *) argument;
if (cast->opening_loc.start == NULL && cast->arguments != NULL) {
return false;
}
break;
}
default: break;
}
return accept1(parser, PM_TOKEN_EQUAL_GREATER);
}

/**
* Append an argument to a list of arguments.
*/
Expand Down Expand Up @@ -14408,7 +14401,7 @@ parse_arguments(pm_parser_t *parser, pm_arguments_t *arguments, bool accepts_for
bool contains_keywords = false;
bool contains_keyword_splat = false;

if (argument_allowed_for_bare_hash(parser, argument)){
if (pm_symbol_node_label_p(argument) || accept1(parser, PM_TOKEN_EQUAL_GREATER)) {
if (parsed_bare_hash) {
pm_parser_err_previous(parser, PM_ERR_ARGUMENT_BARE_HASH);
}
Expand Down
5 changes: 4 additions & 1 deletion process.c
Original file line number Diff line number Diff line change
Expand Up @@ -4011,7 +4011,10 @@ retry_fork_async_signal_safe(struct rb_process_status *status, int *ep,
while (1) {
prefork();
disable_child_handler_before_fork(&old);
#ifdef HAVE_WORKING_VFORK

// Older versions of ASAN does not work with vfork
// See https://github.com/google/sanitizers/issues/925
#if defined(HAVE_WORKING_VFORK) && !defined(RUBY_ASAN_ENABLED)
if (!has_privilege())
pid = vfork();
else
Expand Down
41 changes: 0 additions & 41 deletions test/prism/errors/command_calls_35.txt

This file was deleted.

6 changes: 0 additions & 6 deletions test/prism/fixtures/command_method_call.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,3 @@ def foo = bar 1
!foo 1 or !bar 2

not !foo 1

foo(bar baz, key => value)

foo(bar baz, KEY => value)

foo(bar baz, :key => value)