Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-14698] Refactor to async fails if for-statement contains where-clause #57048

Closed
ahoppen opened this issue Jun 1, 2021 · 1 comment
Closed

Comments

@ahoppen
Copy link
Collaborator

@ahoppen ahoppen commented Jun 1, 2021

Previous ID SR-14698
Radar rdar://78781061
Original Reporter @ahoppen
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug, FoundByStressTester
Assignee None
Priority Medium

md5: 8704e3c68499867c17b8a5108fa5e596

Issue Description:

The following test case crashes:

struct Movie2 {
    let character: Int?
}

// RUN: %refactor -convert-to-async -dump-text -source-filename %s -pos=%(line+1):6
func peoplesStateReducer() {
    let cast: [Movie2] = []
    for meta in cast where meta.character != nil {
    }
}

Stack trace

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-refactor           0x0000000112b48dc7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39
1  swift-refactor           0x0000000112b47be8 llvm::sys::RunSignalHandlers() + 248
2  swift-refactor           0x0000000112b493f6 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff20365d7d _sigtramp + 29
4  libsystem_platform.dylib 0x00007ffee1a8f768 _sigtramp + 18446744072660097544
5  swift-refactor           0x000000010f9d3215 void llvm::SmallVectorImpl<char>::append<char const*, void>(char const*, char const*) + 149
6  swift-refactor           0x0000000112b2e403 llvm::raw_ostream::write(char const*, unsigned long) + 643
7  swift-refactor           0x000000010e1f0d6e (anonymous namespace)::asyncrefactorings::AsyncConverter::walkToExprPre(swift::Expr*) + 1230
8  swift-refactor           0x000000010e215a18 (anonymous namespace)::SemaAnnotator::walkToExprPre(swift::Expr*) + 232
9  swift-refactor           0x000000010f0f14a5 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) + 3093
10 swift-refactor           0x000000010f0f09ff swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) + 367
11 swift-refactor           0x000000010f0edc47 swift::Stmt::walk(swift::ASTWalker&) + 87
12 swift-refactor           0x000000010e2151e6 swift::SourceEntityWalker::walk(swift::Stmt*) + 278
13 swift-refactor           0x000000010e1f44be (anonymous namespace)::asyncrefactorings::AsyncConverter::convertNode(swift::ASTNode, swift::SourceLoc, bool) + 206
14 swift-refactor           0x000000010e1efd72 (anonymous namespace)::asyncrefactorings::AsyncConverter::convert() + 130
15 swift-refactor           0x000000010e1df7a8 (anonymous namespace)::RefactoringActionConvertToAsync::performChange() + 120
16 swift-refactor           0x000000010e1da130 swift::ide::refactorSwiftModule(swift::ModuleDecl*, swift::ide::RefactoringOptions, swift::ide::SourceEditConsumer&, swift::DiagnosticConsumer&) + 2672
17 swift-refactor           0x000000010e170f81 main + 3649
18 libdyld.dylib            0x00007fff2033bf3d start + 1
@ahoppen
Copy link
Collaborator Author

@ahoppen ahoppen commented Jun 9, 2021

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant