Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.4.0
-
None
-
7ee29f69918ef11b83f7ee6acc1fa9c508c9f4a3
Description
Using the new Qt 5.4. This issue doesn't happen in Qt 5.3.2 (or Qt5.4.0-2014-11-26_11-10).
Javascript code that retrieves the integer part of a floating point by bitwise ORing with 0 gives this assertion:
“ASSERT: “casted->type == SInt32Type” in file compiler\qv4ssa.cpp, line 4065”
Example code:
QJSEngine engine;
QString jsCode = "var n = 0.1; var test = (n*255) | 0;";
QJSValue result = engine.evaluate( jsCode );
Also the ~~ notation crashes.
1. This assertion only happens when there is a variable or function call involved. That is, the assertion does not happen if the operation is only with constants like: var test = (0.1 * 255) | 0;
2. This assertion also only happens when ORing with 0. If I change code to OR with 1, assertion does not occur.
This notation is very common e.g. three.js rendering library uses it in many places in the code and three.js doesn't now run on top of Qt 5.4 that includes QtCanvas3D that in theory should run it.