← Back to team overview

ubuntu-sdk-bugs team mailing list archive

[Bug 1312571] [NEW] Simple JS has differing results on AMD64/i386

 

Public bug reported:

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?

** Affects: qtdeclarative-opensource-src (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
SDK bug tracking, which is subscribed to qtdeclarative-opensource-src in
Ubuntu.
https://bugs.launchpad.net/bugs/1312571

Title:
  Simple JS has differing results on AMD64/i386

Status in “qtdeclarative-opensource-src” package in Ubuntu:
  New

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?

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qtdeclarative-opensource-src/+bug/1312571/+subscriptions


Follow ups

References