Simple JS has differing results on AMD64/i386

Bug #1312571 reported by Alan Pope 🍺🐧🐱 🦄
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qtdeclarative-opensource-src (Ubuntu)
Fix Released
Undecided
Timo Jyrinki

Bug Description

Reporting on behalf of mrqtros who filed this upstream.

function safeAdd(x, y)
{ var lsw = (x & 0xFFFF) + (y & 0xFFFF); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); // console.log("res", "(msw << 16) | (lsw & 0xFFFF)") return ((msw << 16) | (lsw & 0xFFFF)); }

This code reports different results depending on the architecture it's run on.

Tested on amd64 and i386 on Ubuntu 14.04 - so 5.2.1.
On amd64 I get -2124464854 with and without console.log()
On i386 I get -2124464854 or 45890858 as per Roman's comment in qt bug https://bugreports.qt-project.org/browse/QTBUG-38451

However on i386 if I set QV4_NO_REGALLOC=1 then it's always -2124464854

Please can the upstream fix at https://codereview.qt-project.org/#change,83936 be applied to our build?

Related branches

Changed in qtdeclarative-opensource-src (Ubuntu):
assignee: nobody → Timo Jyrinki (timo-jyrinki)
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtdeclarative-opensource-src - 5.2.1-5ubuntu1

---------------
qtdeclarative-opensource-src (5.2.1-5ubuntu1) utopic; urgency=medium

  * Resync with Debian including renamed QML packages (LP: #1313547)
  * Depend conditionally on libgl1 (LP: #1278871)
  * debian/patches/Fix-marking-of-prototype-objects-in-chain.patch
    - Fix a crasher with deleted QQmlCompiledData as suggested by upstream
      (LP: #1304248)
  * debian/patches/QQuickItemView-QQuickPathView-Fix-creation-of-delega.patch:
    - Fix "Carousel doesn't re-render properly after scrolling"
      (LP: #1307578)
  * debian/patches/Implement-proper-support-for-layoutChange-in-QQmlDel.patch:
    - Fix a performance hit when editing sorted lists (LP: #1303746)
  * debian/patches/V4-regalloc-fix-register-spill-choice-under-high-pre.patch:
    - Fix differing JS results on AMD64/i386 (LP: #1312571)
  * Updated symbols
 -- Timo Jyrinki <email address hidden> Mon, 28 Apr 2014 07:35:22 +0000

Changed in qtdeclarative-opensource-src (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.