Commit f014a9a
committed
Sema: Don't coerce subexpression of 'try' to rvalue
The change in 8ab8b2e, was too
broad. We want to coerce the subexpression of `try!` to an rvalue,
but not the subexpression of a `try`.
If the subexpression of a `try` becomes an rvalue even though the
type of the parent expression is an lvalue, we can end up with
infinite recursion in coerceToType(), as demonstrated by the
test case.
Fixes #85034.1 parent 97f7efd commit f014a9a
File tree
2 files changed
+15
-1
lines changed- lib/Sema
- validation-test/compiler_crashers_fixed
2 files changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3752 | 3752 | | |
3753 | 3753 | | |
3754 | 3754 | | |
3755 | | - | |
| 3755 | + | |
| 3756 | + | |
| 3757 | + | |
| 3758 | + | |
| 3759 | + | |
3756 | 3760 | | |
3757 | 3761 | | |
3758 | 3762 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments