diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2024-02-05 11:57:27 -0500 |
|---|---|---|
| committer | Kevin Newton <kddnewton@gmail.com> | 2024-02-05 11:57:38 -0500 |
| commit | ae7816bc20eefc75be98e5bb3955fe53b932d88f (patch) | |
| tree | e3f44110cd0cfafd2eda050a509f8163eada33b3 | |
| parent | 948c618bdadfc412678dd6e00e11fc8b85053173 (diff) | |
[PRISM] Fix up idUMinus optimization
| -rw-r--r-- | prism_compile.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/prism_compile.c b/prism_compile.c index 0644a76eea..accbd840c1 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -4160,6 +4160,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, if ((method_id == idUMinus || method_id == idFreeze) && !PM_NODE_FLAG_P(call_node, PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) && + call_node->receiver != NULL && PM_NODE_TYPE_P(call_node->receiver, PM_STRING_NODE) && call_node->arguments == NULL && call_node->block == NULL && @@ -4192,7 +4193,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, } else if (method_id == idASET && !PM_NODE_FLAG_P(call_node, PM_CALL_NODE_FLAGS_SAFE_NAVIGATION) && - call_node->arguments && + call_node->arguments != NULL && PM_NODE_TYPE_P((pm_node_t *)call_node->arguments, PM_ARGUMENTS_NODE) && ((pm_arguments_node_t *)call_node->arguments)->arguments.size == 2 && PM_NODE_TYPE_P(((pm_arguments_node_t *)call_node->arguments)->arguments.nodes[0], PM_STRING_NODE) && |
