Details
-
Bug
-
Resolution: Done
-
P0: Blocker
-
5.8.0 RC
-
None
-
Ubuntu 16.10, Qt 5.8 RC
-
fffb997e192a72b4dcd66edc2fbad5473dd359f3 (qtdeclarative)
Description
There is a problem with the Javascript/QML Engine in Qt 5.8 RC. When I run this minimal example with qmlscene 5.8 on my system I get erroneous runtime behaviour:
import QtQuick 2.7 Text { function broken(n) { var x = 2.; console.log("x start = " + x); while (n/x > 1000) { x += 2.; console.log("x in while = " + x); } console.log("x end = " + x); return x; } text: (broken(4000) === 4) ? "result ok" : "error in js engine?" }
With Qt 5.7, I get the expected result:
qml: x start = 2
qml: x in while = 4
qml: x end = 4
With Qt 5.8 RC, I get (for given parameters):
qml: x start = 2
qml: x in while = 4
qml: x end = 0
Reordering the print statements in the code sometimes result in a working program. Some parameters even cause an endless loop with x being corrupted within the loop.
I reproduced this on two different Ubuntu 16.10 machines with the gcc-64 build. I cannot reproduce this on Windows with the msvc2013-64 build.
Attachments
For Gerrit Dashboard: QTBUG-57779 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
181498,2 | Fix incorrect JavaScript evaluation with the JIT | 5.8.0 | qt/qtdeclarative | Status: MERGED | +2 | 0 |