-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Abort checking when encountering an invalid parse node #4700
Conversation
@@ -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`"); |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Looks like a check_fuzzer timeout, just flaky. (another run took 3s, so some abnormal issue) |
Short term solution/block for #4689