Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abort checking when encountering an invalid parse node #4700

Merged

Conversation

dwblaikie
Copy link
Contributor

Short term solution/block for #4689

@@ -346,6 +346,11 @@ auto CheckUnit::ProcessNodeIds() -> bool {
node_id = *maybe_node_id;
auto parse_kind = context_.parse_tree().node_kind(node_id);

if (context_.parse_tree().node_has_error(node_id)) {
context_.TODO(node_id, "handle invalid parse trees in `check`");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where this causes code to no longer be reached, would it be worth switching to CARBON_FATAL?

e.g.:

  • HandleInvalidParse (and variants)
  • The pre-existing TODOs for "Error recovery from keyword name"

(for contrast, valid code encounters "function with positional parameters", you're only removing 1 case of 4)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yep - done.
I did change the "Error recovery from keyword name" to CARBON_CHECK since otherwise they'd be branch-to-unreachable (which is disfavorable in the LLVM style, at least) - happy to switch back to CARBON_FATAL if it makes more sense in this particular case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to CHECK where it fits.

@jonmeow jonmeow added this pull request to the merge queue Dec 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 17, 2024
@jonmeow jonmeow added this pull request to the merge queue Dec 18, 2024
@jonmeow
Copy link
Contributor

jonmeow commented Dec 18, 2024

Looks like a check_fuzzer timeout, just flaky. (another run took 3s, so some abnormal issue)

Merged via the queue into carbon-language:trunk with commit 4d0a6db Dec 18, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants