-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwaretriage neededThis issue needs more specific labelsThis issue needs more specific labels
Description
Description
Using reasync
function in non-async
function causes an assertion failure in IRGen
Reproduction
func reasyncFn(fn: () async -> Void) reasync {}
func test() {
reasyncFn { _ = 1 }
}
Stack dump
% ../build/release/swift-macosx-arm64/bin/swift -frontend -emit-ir -enable-experimental-concurrency test.swift
Assertion failed: (isAsync()), function getAsyncContext, file GenCall.cpp, line 215.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0. Program arguments: /Users/rintaro/Repositories/swift-oss/build/release/swift-macosx-arm64/bin/swift-frontend -emit-ir -enable-experimental-concurrency test.swift
1. Swift version 6.2-dev (LLVM 23dd6ab259a178a, Swift f510342c8a9de12)
2. Compiling with effective version 5.10
3. While evaluating request IRGenRequest(IR Generation for module test)
4. While emitting IR SIL function "@$s4testAAyyF".
for 'test()' (at test.swift:2:1)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 swift-frontend 0x0000000105d2f02c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1 swift-frontend 0x0000000105d2d77c llvm::sys::RunSignalHandlers() + 112
2 swift-frontend 0x0000000105d2f674 SignalHandler(int, __siginfo*, void*) + 296
3 libsystem_platform.dylib 0x000000018efcae04 _sigtramp + 56
4 libsystem_pthread.dylib 0x000000018ef93f70 pthread_kill + 288
5 libsystem_c.dylib 0x000000018eea0908 abort + 128
6 libsystem_c.dylib 0x000000018ee9fc1c err + 0
7 swift-frontend 0x0000000105d3e958 swift::irgen::ExplosionSchema::getScalarResultType(swift::irgen::IRGenModule&) const (.cold.3) + 0
8 swift-frontend 0x0000000100b761d8 (anonymous namespace)::AsyncCallEmission::setArgs(swift::irgen::Explosion&, bool, swift::irgen::WitnessMetadata*) + 1676
9 swift-frontend 0x0000000100d1f97c (anonymous namespace)::IRGenSILFunction::visitFullApplySite(swift::FullApplySite) + 3060
10 swift-frontend 0x0000000100d01cd8 (anonymous namespace)::IRGenSILFunction::visitSILBasicBlock(swift::SILBasicBlock*) + 2188
11 swift-frontend 0x0000000100d004c4 (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 8836
12 swift-frontend 0x0000000100cfdcc0 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 1828
13 swift-frontend 0x0000000100baf598 swift::irgen::IRGenerator::emitGlobalTopLevel(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) + 728
14 swift-frontend 0x0000000100cb5ca0 swift::IRGenRequest::evaluate(swift::Evaluator&, swift::IRGenDescriptor) const + 2376
15 swift-frontend 0x0000000100cfd250 swift::GeneratedModule swift::SimpleRequest<swift::IRGenRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)17>::callDerived<0ul>(swift::Evaluator&, std::__1::integer_sequence<unsigned long, 0ul>) const + 176
16 swift-frontend 0x0000000100cbd194 swift::IRGenRequest::OutputType swift::Evaluator::getResultUncached<swift::IRGenRequest, swift::IRGenRequest::OutputType swift::evaluateOrFatal<swift::IRGenRequest>(swift::Evaluator&, swift::IRGenRequest)::'lambda'()>(swift::IRGenRequest const&, swift::IRGenRequest::OutputType swift::evaluateOrFatal<swift::IRGenRequest>(swift::Evaluator&, swift::IRGenRequest)::'lambda'()) + 196
17 swift-frontend 0x0000000100cb6bfc swift::performIRGeneration(swift::ModuleDecl*, swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, llvm::GlobalVariable**) + 1356
18 swift-frontend 0x000000010083b5f8 generateIR(swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, llvm::GlobalVariable*&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>) + 272
19 swift-frontend 0x00000001008382e0 performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 1332
20 swift-frontend 0x0000000100837abc swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1312
21 swift-frontend 0x0000000100843970 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 164
22 swift-frontend 0x0000000100839400 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 700
23 swift-frontend 0x0000000100838c5c swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2208
24 swift-frontend 0x000000010062afcc swift::mainEntry(int, char const**) + 3052
25 dyld 0x000000018ec14274 start + 2840
zsh: abort ../build/release/swift-macosx-arm64/bin/swift -frontend -emit-ir test.swift
Expected behavior
Compiles without errors
Environment
main
as of today
Additional information
No response
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwaretriage neededThis issue needs more specific labelsThis issue needs more specific labels