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

Unused JS conditional var in unused function crashes QQmlEngine

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.7.0, 5.7.1
    • Fix Version/s: 5.6.2, 5.8.0
    • Labels:
      None
    • Environment:
      windows 7 x64, ubuntu 16.04 GCC 5.3 x32 & x64
    • Commits:
      c4ebe96c34c2179d0ebdc555afdce179e3de52e8 (qtdeclarative)

      Description

      Reproduced on a variety of platforms:

      import QtQuick 2.7
      import QtQuick.Window 2.2
      
      Window {
        id: main
        visible: true
        width: 500
        height: 300
      
        function foo() {
          var c = main.width > 1 ? 27 : -147
        }
      }
      

      The conditional has to be used and the var has to be unused, otherwise it doesn't crash. The function doesn't need to be executed, it crashes during QQmlEngine.load()

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              srutledg Shawn Rutledge
              Reporter:
              dgo dgo
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes