Commit Graph

5 Commits

Author SHA1 Message Date
Allan Shortlidge
51b9f4d079 Tests: Use Swift version aligned target triples in some IRGen tests. 2024-11-20 10:08:45 -08:00
Joe Groff
9defe1f141 Merge pull request #42274 from jckarter/async-let-back-deploy-workaround-arm64e-workaround
Disable test/IRGen/async_let_back_deploy_workaround.swift on arm64e.
2022-04-08 23:20:52 -07:00
Joe Groff
5bb3f66944 Disable test/IRGen/async_let_back_deploy_workaround.swift on arm64e.
rdar://91370360
2022-04-08 17:27:52 -07:00
Joe Groff
d451203b7f SILGen: Emit async let entry points at correct abstraction level.
Avoid a reabstraction thunk every time an async let entry point is emitted,
by setting the context abstraction level while we emit the implicit closure.
Adjust some surrounding logic that breaks when we do this:

- When lowering a non-throwing function type against a throwing abstraction
  pattern, include the error type in the lowered substituted type. Async
  throwing and nonthrowing functions would require another thunk to convert
  away the throwingness of the async context, which would defeat the purpose.
- Adjust the code in IRGen that pads the initial context size for `async let`
  entry points so that it works when the entry point has not yet emitted, by
  marking the async function pointer to be padded later if it isn't defined
  yet.
2022-03-30 14:51:46 -07:00
Joe Groff
6f68eae7ba IRGen: Artificially pad async let entry point contexts.
We fixed a bug in the concurrency runtime (rdar://problem/90357994) that would
lead to memory corruption when a new `async let` child task tried to use the
last 16 bytes of the preallocated slab from its parent to seed its own task
allocator. To work around this bug in older OSes that shipped with the bug,
artificially pad the async coroutine context size for any async functions
used as an `async let` entry point, which will prevent the runtime from
going down the path of trying to use the preallocated storage at all.
rdar://90506708
2022-03-25 16:06:00 -07:00