Dyno: branch sensitive try-catch#27591
Merged
DanilaFe merged 2 commits intochapel-lang:mainfrom Aug 7, 2025
Merged
Conversation
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
arifthpe
requested changes
Aug 6, 2025
arifthpe
approved these changes
Aug 6, 2025
3 tasks
DanilaFe
added a commit
that referenced
this pull request
Aug 22, 2025
Closes Cray/chapel-private#7624. Follows up on #27591, which introduced branch-sensitivity to try-catch analysis. What was missing was a call to `markFatalError`, which is required when traversing calls to `compilerError`, to tell the branch-sensitive visitor to stop visiting subsequent code. Thus, in some cases, we'd try to access code past the end of available resolution information, and crash. This should fix that. Notably, the error message / error handling for broken iterators (that have `compilerError` in them) is not addressed by this PR. It's a limitation of the compiler's handling of erroneous code, so it is taking a bit of a back seat. See Cray/chapel-private#7620 (the specific error seen here) and Cray/chapel-private#7622, which I am now realizing is probably the root cause. ## Testing - [x] dyno tests - [x] paratest - [x] paratest `--dyno-resolve-only` Reviewed by @benharsh -- thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes https://github.com/Cray/chapel-private/issues/7403.
This PR addresses an internal error caused by the try-catch pass expecting a resolution result where there is none. Since the resolver always sets the type of try-catch variables, I deduced the issue was due to the resolver never visiting the code that
TryCatchAnalyzer(TCA) is handling.Indeed, the
Resolvervisitor, as well as many other Dyno visitors, skip dead code. However, TCA was not hooked up to do this, and thus was visiting dead code and balking at the lack of resolution results. This PR adjusts the TCA to also be branch-sensitive, by having it inherit fromBranchSensitiveVisitorand invoke the necessary methods.Testing
test/types/range/cast-assign-init/casts-2.chplresolves--dyno-resolve-onlyReviewed by @arifthpe -- thanks!