Bug 1132290 - IonMonkey: Remove indirect truncation of MLoadTypedArrayElementStatic, r=nbp

This commit is contained in:
Hannes Verschore 2015-02-13 10:57:26 +01:00
parent a7692466c4
commit 1e632bf60c
2 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,10 @@
f = function() {
v = Uint8Array()
function f(x) {
return x + v[0] | 0
}
return f
}()
assertEq(f(0), 0)
assertEq(f(1), 0)

View File

@ -2517,7 +2517,10 @@ MToDouble::truncate()
bool
MLoadTypedArrayElementStatic::needTruncation(TruncateKind kind)
{
if (kind >= IndirectTruncate)
// IndirectTruncate not possible, since it returns 'undefined'
// upon out of bounds read. Doing arithmetic on 'undefined' gives wrong
// results. So only set infallible if explicitly truncated.
if (kind == Truncate)
setInfallible();
return false;