You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swift-ci opened this issue
Mar 13, 2018
· 6 comments
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfruntimeThe Swift Runtime
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:
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.
Add a ``reabstract_function`` SIL instruction to apply the reabstraction instead of just ``partial_apply``. This is probably necessary for the static optimization anyway.
Come up with some way of describing a function abstraction pattern with a string.
Reserve a heap metadata kind for reabstraction thunks. This kind dictates the layout of the thunk, which is just the original function and a pointer to the pattern string for the original function (and possibly some captured type data).
Instead of unconditionally allocating a reabstraction thunk in ``reabstract_function``, ask the runtime to do it, handing it the original and target pattern strings as well as the original function value.
The runtime function (recursively) looks for a reabstraction-thunk context whose original pattern matches the target pattern. If it finds one, it copies the function value from that context; otherwise, it allocates a reabstraction thunk.
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfruntimeThe Swift Runtime
Environment
macOS 10.13.3 (17D102)
XCode 9.2
Swift 4.0
Additional Detail from JIRA
md5: 0dc8da060ef08555dc3c6e2968d997d7
Issue 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:
The text was updated successfully, but these errors were encountered: