Details
Description
qmlcachegen miscompiles the following function if all of the involved number types are integers:
function execute() { let ihn = input(); if (!ihn) return; let result = ihn.value; if (direction === Direction.BACKWARD) { if (offset) result -= offset.value; if (scale) result /= scale.value; } else { if (scale) result *= scale.value; if (offset) result += offset.value; } setOutput(result); }
This is because it promotes some values to double, and some not and then chooses to read the double value on setOutput(), disregarding the result of the branches that produce integer values.
Attachments
For Gerrit Dashboard: QTBUG-118514 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
513853,3 | QmlCompiler: Generate jump code also when skipping an instruction | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
515115,2 | QmlCompiler: Generate jump code also when skipping an instruction | 6.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
515461,3 | QmlCompiler: Generate jump code also when skipping an instruction | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |