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

Unreachable hit in incremental parsing: "node not deferred"

    XMLWordPrintable

    Details

      Description

      To reproduce, add the following test case under test/incrParse and run the tests:

      // RUN: %empty-directory(%t)
      // RUN: %validate-incrparse %s --test-case REPLACE
      
      
      var value: Int {
          get { fatalError() }
      <<REPLACE<|||}>>>
      
      let x = 10
      

      Here's the trace:

      1.	With parser at source location: /Users/nhawes/github/build/Ninja-ReleaseAssert/swift-macosx-x86_64/test-macosx-x86_64/incrParse/Output/testcase.swift.tmp/temp/testcase.swift.REPLACE.post.swift:6:24
      0  swift-syntax-test        0x0000000102e8cc18 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
      1  swift-syntax-test        0x0000000102e8bb58 llvm::sys::RunSignalHandlers() + 248
      2  swift-syntax-test        0x0000000102e8d2a7 SignalHandler(int) + 295
      3  libsystem_platform.dylib 0x00007fff6e6cf41d _sigtramp + 29
      4  swift-syntax-test        0x00000001068123ca llvm::APInt::toString(llvm::SmallVectorImpl<char>&, unsigned int, bool, bool) const::Digits + 1418218
      5  libsystem_c.dylib        0x00007fff6e5a49c8 abort + 120
      6  swift-syntax-test        0x0000000105a3916e llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 462
      7  swift-syntax-test        0x0000000103ae1ad0 swift::ParsedRawSyntaxNode::makeDeferred(swift::syntax::SyntaxKind, llvm::MutableArrayRef<swift::ParsedRawSyntaxNode>, swift::SyntaxParsingContext&) + 992
      8  swift-syntax-test        0x0000000103b265ca void llvm::function_ref<void (swift::syntax::SyntaxKind, llvm::MutableArrayRef<swift::ParsedRawSyntaxNode>)>::callback_fn<swift::SyntaxParsingContext::createSyntaxAs(swift::syntax::SyntaxKind, llvm::MutableArrayRef<swift::ParsedRawSyntaxNode>, swift::SyntaxNodeCreationKind)::$_0>(long, swift::syntax::SyntaxKind, llvm::MutableArrayRef<swift::ParsedRawSyntaxNode>) + 74
      9  swift-syntax-test        0x0000000103b37944 swift::ParsedSyntaxRecorder::formExactLayoutFor(swift::syntax::SyntaxKind, llvm::MutableArrayRef<swift::ParsedRawSyntaxNode>, llvm::function_ref<void (swift::syntax::SyntaxKind, llvm::MutableArrayRef<swift::ParsedRawSyntaxNode>)>) + 50580
      10 swift-syntax-test        0x0000000103b23a88 swift::SyntaxParsingContext::createSyntaxAs(swift::syntax::SyntaxKind, llvm::MutableArrayRef<swift::ParsedRawSyntaxNode>, swift::SyntaxNodeCreationKind) + 120
      11 swift-syntax-test        0x0000000103b24f74 swift::SyntaxParsingContext::createNodeInPlace(swift::syntax::SyntaxKind, unsigned long, swift::SyntaxNodeCreationKind) + 132
      12 swift-syntax-test        0x0000000103b25d02 swift::SyntaxParsingContext::~SyntaxParsingContext() + 146
      13 swift-syntax-test        0x0000000103b0af75 swift::Parser::parseBraceItems(llvm::SmallVectorImpl<swift::ASTNode>&, swift::BraceItemListKind, swift::BraceItemListKind) + 4789
      14 swift-syntax-test        0x0000000103b0f7f6 swift::Parser::parseBraceItemList(swift::Diag<>) + 230
      15 swift-syntax-test        0x0000000103ad916e swift::Parser::parseAbstractFunctionBody(swift::AbstractFunctionDecl*) + 718
      16 swift-syntax-test        0x0000000103ad837f swift::Parser::parseGetSet(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, swift::GenericParamList*, swift::ParameterList*, swift::Parser::ParsedAccessors&, swift::AbstractStorageDecl*, swift::SourceLoc) + 3199
      17 swift-syntax-test        0x0000000103ad9727 swift::Parser::parseDeclVarGetSet(swift::Pattern*, swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, swift::SourceLoc, swift::StaticSpellingKind, swift::SourceLoc, bool, swift::DeclAttributes const&, llvm::SmallVectorImpl<swift::Decl*>&) + 871
      18 swift-syntax-test        0x0000000103adad39 swift::Parser::parseDeclVar(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, swift::DeclAttributes&, llvm::SmallVectorImpl<swift::Decl*>&, swift::SourceLoc, swift::StaticSpellingKind, swift::SourceLoc, bool) + 2873
      19 swift-syntax-test        0x0000000103acc18f swift::Parser::parseDecl(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, bool, llvm::function_ref<void (swift::Decl*)>)::$_11::operator()(bool) const + 111
      20 swift-syntax-test        0x0000000103ac93e4 swift::Parser::parseDecl(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, bool, llvm::function_ref<void (swift::Decl*)>) + 1156
      21 swift-syntax-test        0x0000000103b0a442 swift::Parser::parseBraceItems(llvm::SmallVectorImpl<swift::ASTNode>&, swift::BraceItemListKind, swift::BraceItemListKind) + 1922
      22 swift-syntax-test        0x0000000103ab9099 swift::Parser::parseTopLevel() + 1689
      23 swift-syntax-test        0x0000000103346708 parseIntoSourceFileImpl(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, bool, bool) + 584
      24 swift-syntax-test        0x00000001033467f3 swift::parseIntoSourceFileFull(swift::SourceFile&, unsigned int, swift::PersistentParserState*, bool) + 35
      25 swift-syntax-test        0x00000001030b01b7 swift::CompilerInstance::performParseOnly(bool, bool) + 647
      26 swift-syntax-test        0x0000000102dab27f (anonymous namespace)::parseFile(char const*, llvm::StringRef, llvm::function_ref<int (swift::SourceFile*, swift::SyntaxParsingCache*)>) + 4223
      27 swift-syntax-test        0x0000000102da77a3 invokeCommand(char const*, llvm::StringRef) + 2691
      28 swift-syntax-test        0x0000000102da7e35 main + 645
      29 libdyld.dylib            0x00007fff6e4d6d99 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: