Open swift-ci opened 6 years ago
@jckarter, @slavapestov, do we already have a bug tracking this? The "closure thunks stack" issue?
Reproduces on master, by the way.
I don't think we have a bug specifically tracking avoiding repeat reabstractions. cc @rjmccall
This one works for me. I think we might have something tracking the perf side of it, but not the correctness side.
I think the optimizer can eliminate redundant re-abstractions at compile time sometimes but we definitely can't do anything at runtime or in unoptimized builds.
We could definitely do something at runtime:
Environment
macOS 10.13.3 (17D102) XCode 9.2 Swift 4.0Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, Runtime | |Assignee | None | |Priority | Medium | md5: 0dc8da060ef08555dc3c6e2968d997d7Issue Description:
Run this code as a console application and you'll find the application eventually overflows its stack. It takes about a minute for it to overflow on my computer. The code:
Here's a snip of the stack when it crashes with EXC_BAD_ACCESS code=2: