Uploaded image for project: 'Swift'
  1. Swift
  2. SR-13219

Code completion: Assertion failed: (Index < Length && "Invalid index!")

    XMLWordPrintable

    Details

      Description

      Reproducer:

      func myFunc(_: Int, _: Undefined) {}
      undefined {
        myFunc($0, undefined)
      }/*complete here*/ 

      Trace:

      Thread 3 Crashed:Thread 3 Crashed:0   libsystem_kernel.dylib         0x00007fff720cd33a __pthread_kill + 101   libsystem_pthread.dylib        0x00007fff72189e60 pthread_kill + 4302   libsystem_c.dylib              0x00007fff720548a2 __abort + 1393   libsystem_c.dylib              0x00007fff72054817 abort + 1354   libsystem_c.dylib              0x00007fff72053ac6 __assert_rtn + 3145   com.apple.SourceKitService.5.0.20200712101_osx 0x000000010e5d8ec3 (anonymous namespace)::CCExprRemover::walkToExprPre(swift::Expr*) (.cold.13) + 356   com.apple.SourceKitService.5.0.20200712101_osx 0x000000010b4f7989 (anonymous namespace)::CCExprRemover::walkToExprPre(swift::Expr*) + 14177   com.apple.SourceKitService.5.0.20200712101_osx 0x000000010c38bd69 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) + 17698   com.apple.SourceKitService.5.0.20200712101_osx 0x000000010c38b7ef swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) + 3679   com.apple.SourceKitService.5.0.20200712101_osx 0x000000010c389f0a swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) + 293810  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010c389493 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) + 25911  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010c38b5af (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) + 20712  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010c388de1 swift::Expr::walk(swift::ASTWalker&) + 8113  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010b4f523a swift::ide::removeCodeCompletionExpr(swift::ASTContext&, swift::Expr*&) + 5814  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010b4c888a (anonymous namespace)::CodeCompletionCallbacksImpl::doneParsing() + 2189815  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010c263a69 swift::Parser::performCodeCompletionSecondPassImpl(swift::CodeCompletionDelayedDeclState&) + 85716  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010c263603 swift::CodeCompletionSecondPassRequest::evaluate(swift::Evaluator&, swift::SourceFile*, swift::CodeCompletionCallbacksFactory*) const + 21117  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010c26dcd6 llvm::Expected<swift::CodeCompletionSecondPassRequest::OutputType> swift::Evaluator::getResultUncached<swift::CodeCompletionSecondPassRequest>(swift::CodeCompletionSecondPassRequest const&) + 37418  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010c26db06 llvm::Expected<swift::CodeCompletionSecondPassRequest::OutputType> swift::Evaluator::operator()<swift::CodeCompletionSecondPassRequest, (void*)0>(swift::CodeCompletionSecondPassRequest const&) + 11819  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010c263439 swift::CodeCompletionSecondPassRequest::OutputType swift::evaluateOrDefault<swift::CodeCompletionSecondPassRequest>(swift::Evaluator&, swift::CodeCompletionSecondPassRequest, swift::CodeCompletionSecondPassRequest::OutputType) + 4120  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010b3cb021 void llvm::function_ref<void (swift::CompilerInstance&, bool)>::callback_fn<swiftCodeCompleteImpl(SourceKit::SwiftLangSupport&, llvm::MemoryBuffer*, unsigned int, (anonymous namespace)::SwiftCodeCompletionConsumer&, llvm::ArrayRef<char const*>, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, bool, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)::$_2>(long, swift::CompilerInstance&, bool) + 43321  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010b4f2cf9 swift::ide::CompletionInstance::performNewOperation(llvm::Optional<llvm::hash_code>, swift::CompilerInvocation&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, llvm::MemoryBuffer*, unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, swift::DiagnosticConsumer*, llvm::function_ref<void (swift::CompilerInstance&, bool)>) + 58522  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010b4f329b swift::ide::CompletionInstance::performOperation(swift::CompilerInvocation&, llvm::ArrayRef<char const*>, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, llvm::MemoryBuffer*, unsigned int, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, swift::DiagnosticConsumer*, llvm::function_ref<void (swift::CompilerInstance&, bool)>) + 84323  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010b400e62 SourceKit::SwiftLangSupport::performCompletionLikeOperation(llvm::MemoryBuffer*, unsigned int, llvm::ArrayRef<char const*>, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, llvm::function_ref<void (swift::CompilerInstance&, bool)>) + 249824  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010b3c4c21 SourceKit::SwiftLangSupport::codeComplete(llvm::MemoryBuffer*, unsigned int, SourceKit::OptionsDictionary*, SourceKit::CodeCompletionConsumer&, llvm::ArrayRef<char const*>, llvm::Optional<SourceKit::VFSOptions>) + 54525  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010b42e8c9 handleSemanticRequest(sourcekitd::RequestDict, std::__1::function<void (void*)>, sourcekitd_uid_s*, llvm::Optional<llvm::StringRef>, llvm::Optional<llvm::StringRef>, llvm::ArrayRef<char const*>, llvm::Optional<SourceKit::VFSOptions>) + 228126  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010b42defa void SourceKit::WorkQueue::DispatchData::callAndDelete<handleRequestImpl(void*, std::__1::function<void (void*)>)::$_4>(void*) + 33027  libdispatch.dylib              0x00007fff71f2c658 _dispatch_client_callout + 828  libdispatch.dylib              0x00007fff71f2ed79 _dispatch_block_invoke_direct + 24529  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010e22527f executeBlock(void*) + 1530  com.apple.SourceKitService.5.0.20200712101_osx 0x000000010b3a98ad threadFuncSync(void*) + 1331  libsystem_pthread.dylib        0x00007fff7218a109 _pthread_start + 14832  libsystem_pthread.dylib        0x00007fff72185b8b thread_start + 15 

        Attachments

          Activity

            People

            Assignee:
            rintaro Rintaro Ishizaki
            Reporter:
            nathawes Nathan Hawes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: