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

Crash creating unbound reference to protocol method

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Duplicate
    • Component/s: Compiler
    • Labels:
    • Environment:

      Apple Swift version 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29)

      Target: x86_64-apple-darwin19.3.0

      macOS 10.15.3

      Description

      This code:

      protocol Pit {
          func pat()
      }
      
      Pit.pat
      

      …causes a compiler crash:

       

      0  lldb                     0x000000010cf1bf08 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
      1  lldb                     0x000000010cf1b4c5 llvm::sys::RunSignalHandlers() + 85
      2  lldb                     0x000000010cf1c550 SignalHandler(int) + 272
      3  libsystem_platform.dylib 0x00007fff7160842d _sigtramp + 29
      4  libsystem_platform.dylib 0x00007fc106e95d40 _sigtramp + 2508773680
      5  LLDB                     0x000000011098742b swift::Lowering::SILGenFunction::emitOpenExistentialExprImpl(swift::OpenExistentialExpr*, llvm::function_ref<void (swift::Expr*)>) + 379
      6  LLDB                     0x000000011098954c swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 4844
      7  LLDB                     0x000000011097e586 swift::Lowering::SILGenFunction::emitRValue(swift::Expr*, swift::Lowering::SGFContext) + 22
      8  LLDB                     0x0000000110926764 swift::Lowering::ArgumentSource::getAsRValue(swift::Lowering::SILGenFunction&, swift::Lowering::SGFContext) && + 36
      9  LLDB                     0x00000001109ac27d swift::Lowering::SILGenFunction::emitAssignToLValue(swift::SILLocation, swift::Lowering::ArgumentSource&&, swift::Lowering::LValue&&) + 477
      10 LLDB                     0x00000001109970b4 emitSimpleAssignment(swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Expr*, swift::Expr*) + 836
      11 LLDB                     0x000000011098ba1d swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 14269
      12 LLDB                     0x0000000110980bdd swift::Lowering::SILGenFunction::emitIgnoredExpr(swift::Expr*) + 797
      13 LLDB                     0x00000001109dbbd0 (anonymous namespace)::StmtEmitter::visitBraceStmt(swift::BraceStmt*) + 320
      14 LLDB                     0x00000001109d8fca swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 10410
      15 LLDB                     0x00000001109d6715 swift::Lowering::SILGenFunction::emitStmt(swift::Stmt*) + 21
      16 LLDB                     0x00000001109386a8 swift::Lowering::SILGenModule::visitTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 344
      17 LLDB                     0x0000000110938bc3 swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*) + 899
      18 LLDB                     0x0000000110939728 swift::SILModule::constructSIL(swift::ModuleDecl*, swift::Lowering::TypeConverter&, swift::SILOptions&, swift::FileUnit*) + 216
      19 LLDB                     0x0000000110939ad9 swift::performSILGeneration(swift::FileUnit&, swift::Lowering::TypeConverter&, swift::SILOptions&) + 25
      20 LLDB                     0x000000011032f3e2 lldb_private::SwiftExpressionParser::Parse(lldb_private::DiagnosticManager&, unsigned int, unsigned int) + 5762
      21 LLDB                     0x000000011033cc1a lldb_private::SwiftUserExpression::Parse(lldb_private::DiagnosticManager&, lldb_private::ExecutionContext&, lldb_private::ExecutionPolicy, bool, bool) + 1066
      22 LLDB                     0x00000001100ceb5a lldb_private::UserExpression::Evaluate(lldb_private::ExecutionContext&, lldb_private::EvaluateExpressionOptions const&, llvm::StringRef, llvm::StringRef, lldb_private::SharingPtr<lldb_private::ValueObject>&, lldb_private::Status&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, std::__1::shared_ptr<lldb_private::Module>*, lldb_private::ValueObject*) + 1770
      23 LLDB                     0x00000001100cca97 lldb_private::REPL::IOHandlerInputComplete(lldb_private::IOHandler&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 1847
      24 LLDB                     0x0000000110044957 lldb_private::IOHandlerEditline::Run() + 375
      25 LLDB                     0x000000011002cb89 lldb_private::Debugger::ExecuteIOHandlers() + 105
      26 LLDB                     0x000000011002f463 lldb_private::Debugger::IOHandlerThread(void*) + 19
      27 LLDB                     0x00000001100d6547 lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) + 103
      28 libsystem_pthread.dylib  0x00007fff71613e65 _pthread_start + 148
      29 libsystem_pthread.dylib  0x00007fff7160f83b thread_start + 15
      Segmentation fault: 11
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              pcantrell Paul Cantrell
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: