File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -3077,6 +3077,17 @@ pm_call_target_node_create(pm_parser_t *parser, pm_call_node_t *target) {
30773077 .message_loc = target->message_loc
30783078 };
30793079
3080+ /* It is possible to get here where we have parsed an invalid syntax tree
3081+ * where the call operator was not present. In that case we will have a
3082+ * problem because it is a required location. In this case we need to fill
3083+ * it in with a fake location so that the syntax tree remains valid. */
3084+ if (node->call_operator_loc.start == NULL) {
3085+ node->call_operator_loc = (pm_location_t) {
3086+ .start = target->base.location.start,
3087+ .end = target->base.location.start
3088+ };
3089+ }
3090+
30803091 // Here we're going to free the target, since it is no longer necessary.
30813092 // However, we don't want to call `pm_node_destroy` because we want to keep
30823093 // around all of its children since we just reused them.
You can’t perform that action at this time.
0 commit comments