Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-83915

qtdeclarative/tools/qmllint crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 6.0
    • 6.0
    • QML: Tooling
    • 45537009a8a3f8e855c1adf0208084849b6dc9c4 (qt/qtdeclarative/dev)

    Description

      Actual version is dev branch (e25bd7a3b76107eb3da3e1eb4e8667ce99b4d20a)

      qmllint -U crashes on code like this:

                  Connections {
                      target: FirstRunDialog
                      onSignInResponse: {
                          animationProgress.stopAnimation()
                          if (err) {
                              errorText.text = err
                              errorMsg.visible = true
                              errTimer.running = true
                          } else {
                              textPageStr.text = qsTr("Welcome")
                              textPageBut.text = qsTr("Continue")
                              welcomePage.index = 2
                          }
                      }
                  }
      

      where firstRunDialog is registered like this:
      engine.rootContext()->setContextProperty("FirstRunDialog", firstRunDialog);

      qmllint crashes qtdeclarative/tools/qmllint/findunqualified.cpp:714:

              auto targetScope = m_qmlid2scope[outstandingConnection.targetName];
              if (outstandingConnection.scope)
                  outstandingConnection.scope->addMethods(targetScope->methods());                                                                                                  
      

      because of targetScope is nullptr,
      outstandingConnection.targetName: "FirstRunDialog".

      I can fix this bug with:

      -          if (outstandingConnection.scope)
      +         if (outstandingConnection.scope && targetScope)
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ulherman Ulf Hermann
            evgeniy_dushistov evgeniy_dushistov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes