Commit c1bac12
committed
[CSSimplify] Fix warning check to account that "from" might be less optional than "to" type
While checking whether compiler needs to produce a checked cast warning,
account for the fact that "from" could be less optional than "to" e.g.
`0 as Any?`, so the difference has to be stored as a signed integer
otherwise it's going to underflow and result in a crash or infinite
recursion in the diagnostics.
Resolves: rdar://795236051 parent fc982ae commit c1bac12
File tree
2 files changed
+8
-1
lines changed- lib/Sema
- validation-test/Sema/type_checker_crashers_fixed
2 files changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6549 | 6549 | | |
6550 | 6550 | | |
6551 | 6551 | | |
6552 | | - | |
| 6552 | + | |
| 6553 | + | |
| 6554 | + | |
6553 | 6555 | | |
6554 | 6556 | | |
6555 | 6557 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments