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

Assertion failed: ((bs->empty()) && "Might mess up insertion point" " Try compiling with '-disable-astscope-lookup'.")

    XMLWordPrintable

    Details

      Description

      To reproduce, compile the below incomplete code with the March 31st dev snapshot compiler:

      public struct Foo {
          func bar() {
              var copySelf = self
              repeat { copySelf
      
      private extension String {}
      

      Trace:

      Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
      0   libsystem_kernel.dylib        	0x00007fff6bffe7fa __pthread_kill + 10
      1   libsystem_pthread.dylib       	0x00007fff6c0bbbc1 pthread_kill + 432
      2   libsystem_c.dylib             	0x00007fff6bf85ab6 __abort + 139
      3   libsystem_c.dylib             	0x00007fff6bf85a2b abort + 135
      4   libsystem_c.dylib             	0x00007fff6bf84cd6 __assert_rtn + 314
      5   swift                         	0x00000001118e3f73 swift::ast_scope::ScopeCreator::shouldThisNodeBeScopedWhenFoundInSourceFileBraceStmtOrType(swift::ASTNode) (.cold.2) + 35
      6   swift                         	0x000000010e2565cf swift::ast_scope::ScopeCreator::shouldThisNodeBeScopedWhenFoundInSourceFileBraceStmtOrType(swift::ASTNode) + 95
      7   swift                         	0x000000010e2524d2 swift::ast_scope::ScopeCreator::addSiblingsToScopeTree(swift::ast_scope::ASTScopeImpl*, swift::ast_scope::ASTScopeImpl*, llvm::ArrayRef<swift::ASTNode>) + 130
      8   swift                         	0x000000010e251494 swift::ast_scope::BraceStmtScope::expandSpecifically(swift::ast_scope::ScopeCreator&) + 36
      9   swift                         	0x000000010e250de6 swift::ast_scope::ASTScopeImpl::expandAndBeCurrent(swift::ast_scope::ScopeCreator&) + 150
      10  swift                         	0x000000010e250d3f swift::ExpandASTScopeRequest::evaluate(swift::Evaluator&, swift::ast_scope::ASTScopeImpl*, swift::ast_scope::ScopeCreator*) const + 15
      11  swift                         	0x000000010e2602a5 llvm::Expected<swift::ExpandASTScopeRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExpandASTScopeRequest>(swift::ExpandASTScopeRequest const&) + 469
      12  swift                         	0x000000010e250c2e swift::ExpandASTScopeRequest::OutputType swift::evaluateOrDefault<swift::ExpandASTScopeRequest>(swift::Evaluator&, swift::ExpandASTScopeRequest, swift::ExpandASTScopeRequest::OutputType) + 94
      13  swift                         	0x000000010e25cfdd swift::ast_scope::ASTScopeImpl* swift::ast_scope::ScopeCreator::constructExpandAndInsert<swift::ast_scope::BraceStmtScope, swift::BraceStmt*>(swift::ast_scope::ASTScopeImpl*, swift::BraceStmt*) + 173
      14  swift                         	0x000000010e25cee1 swift::NullablePtr<swift::ast_scope::ASTScopeImpl> swift::ast_scope::ScopeCreator::ifUniqueConstructExpandAndInsert<swift::ast_scope::BraceStmtScope, swift::BraceStmt*>(swift::ast_scope::ASTScopeImpl*, swift::BraceStmt*) + 193
      15  swift                         	0x000000010e250209 swift::ASTVisitor<swift::ast_scope::NodeAdder, swift::NullablePtr<swift::ast_scope::ASTScopeImpl>, swift::NullablePtr<swift::ast_scope::ASTScopeImpl>, swift::NullablePtr<swift::ast_scope::ASTScopeImpl>, void, void, void, swift::ast_scope::ASTScopeImpl*, swift::ast_scope::ScopeCreator&>::visit(swift::Stmt*, swift::ast_scope::ASTScopeImpl*, swift::ast_scope::ScopeCreator&) + 73
      16  swift                         	0x000000010e24e42a swift::ast_scope::ScopeCreator::addToScopeTreeAndReturnInsertionPoint(swift::ASTNode, swift::ast_scope::ASTScopeImpl*) + 122
      17  swift                         	0x000000010e251535 swift::ast_scope::AbstractFunctionBodyScope::expandSpecifically(swift::ast_scope::ScopeCreator&) + 53
      18  swift                         	0x000000010e250de6 swift::ast_scope::ASTScopeImpl::expandAndBeCurrent(swift::ast_scope::ScopeCreator&) + 150
      19  swift                         	0x000000010e250d3f swift::ExpandASTScopeRequest::evaluate(swift::Evaluator&, swift::ast_scope::ASTScopeImpl*, swift::ast_scope::ScopeCreator*) const + 15
      20  swift                         	0x000000010e2602a5 llvm::Expected<swift::ExpandASTScopeRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExpandASTScopeRequest>(swift::ExpandASTScopeRequest const&) + 469
      21  swift                         	0x000000010e250c2e swift::ExpandASTScopeRequest::OutputType swift::evaluateOrDefault<swift::ExpandASTScopeRequest>(swift::Evaluator&, swift::ExpandASTScopeRequest, swift::ExpandASTScopeRequest::OutputType) + 94
      22  swift                         	0x000000010e26328e swift::ast_scope::ASTScopeImpl::findInnermostEnclosingScope(swift::SourceLoc, swift::NullablePtr<llvm::raw_ostream>) + 62
      23  swift                         	0x000000010e24e33f swift::ASTScope::expandFunctionBody(swift::AbstractFunctionDecl*) + 79
      24  swift                         	0x000000010e042fbc swift::TypeCheckFunctionBodyUntilRequest::evaluate(swift::Evaluator&, swift::AbstractFunctionDecl*, swift::SourceLoc) const + 812
      25  swift                         	0x000000010e049fdb llvm::Expected<swift::TypeCheckFunctionBodyUntilRequest::OutputType> swift::Evaluator::getResultUncached<swift::TypeCheckFunctionBodyUntilRequest>(swift::TypeCheckFunctionBodyUntilRequest const&) + 491
      26  swift                         	0x000000010e049b71 llvm::Expected<swift::TypeCheckFunctionBodyUntilRequest::OutputType> swift::Evaluator::getResultCached<swift::TypeCheckFunctionBodyUntilRequest, (void*)0>(swift::TypeCheckFunctionBodyUntilRequest const&) + 129
      27  swift                         	0x000000010e0438d9 swift::TypeCheckFunctionBodyUntilRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckFunctionBodyUntilRequest>(swift::Evaluator&, swift::TypeCheckFunctionBodyUntilRequest, swift::TypeCheckFunctionBodyUntilRequest::OutputType) + 41
      28  swift                         	0x000000010e042c22 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 66
      29  swift                         	0x000000010e072d2e swift::TypeCheckSourceFileRequest::evaluate(swift::Evaluator&, swift::SourceFile*) const + 494
      30  swift                         	0x000000010e074c21 llvm::Expected<swift::TypeCheckSourceFileRequest::OutputType> swift::Evaluator::getResultUncached<swift::TypeCheckSourceFileRequest>(swift::TypeCheckSourceFileRequest const&) + 449
      31  swift                         	0x000000010e0749a4 llvm::Expected<swift::TypeCheckSourceFileRequest::OutputType> swift::Evaluator::getResultCached<swift::TypeCheckSourceFileRequest, (void*)0>(swift::TypeCheckSourceFileRequest const&) + 52
      32  swift                         	0x000000010e072a50 swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType) + 32
      33  swift                         	0x000000010d43b6de swift::CompilerInstance::parseAndTypeCheckMainFileUpTo(swift::SourceFile::ASTStage_t) + 286
      34  swift                         	0x000000010d43a7b7 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 359
      35  swift                         	0x000000010d43a1d8 swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 520
      36  swift                         	0x000000010d348cdd performCompile(swift::CompilerInstance&, swift::CompilerInvocation const&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 1933
      37  swift                         	0x000000010d34759e swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3582
      38  swift                         	0x000000010d2db68d main + 861
      39  libdyld.dylib                 	0x00007fff6beb77fd start + 1
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: