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

bad optimisation for js Array in do while loop

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.9.0
    • 5.8.0, 5.9.0 Alpha
    • None
    • All
    • 8d0d1b11e381130dec12f46b959c3107c3f47160

    Description

      On the example, there are 2 rectangles with same code except a print in the first rectangle.
      If you click on the first rectangle, the result is good.
      If you click on the second, there is the error:
      qrc:/main.qml:48: TypeError: Cannot read property '0' of undefined

      If we don't print all the values for the first rectangle, it also have the error and we can see the values:
      for variable pieces:
      [4,21,6,22,8,23,12,24,10,25,8,26,6,27,4,28,2,31,2,32,2,33,2,35,2,36,2,37,2,38,2,54]
      qml: 2
      for variable p:
      qml: [2,54]
      qml: undefined

      To compile: qmake && make && ./jsoptim

      The code was working fine with Qt5.7 and before.
      The issue is with do-while loop, it works fine with a while loop.

      Attachments

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

        Activity

          People

            erikv Erik Verbruggen
            petitlapin Johnny Jazeix
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes