diff options
author | Alon Zakai <azakai@mozilla.com> | 2011-01-27 21:31:20 -0800 |
---|---|---|
committer | Alon Zakai <azakai@mozilla.com> | 2011-01-27 21:31:20 -0800 |
commit | 5958a6a754324de9eeff39fe1f21ba2b7042f833 (patch) | |
tree | b9a5f9929c3cbe64f9b45ae7be4b6037f2b7b33d /src/jsifier.js | |
parent | 8e51dd91884b48f9c59fed12e995ed9fdbdcd5f8 (diff) |
reSign parallel to unSign to fix rare signing issues; CHECK_SIGNS option
Diffstat (limited to 'src/jsifier.js')
-rw-r--r-- | src/jsifier.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index c64c2ced..3f3c4161 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -752,9 +752,10 @@ function JSify(data, functionsOnly, givenTypes, givenFunctions, givenGlobalVaria return makeOne(0); }); - function makeUnSign(value, type) { + function makeSignOp(value, type, op) { if (type in Runtime.INT_TYPES) { - return 'unSign(' + value + ', ' + type.substr(1) + ')'; + var bits = parseInt(type.substr(1)); + return op + 'Sign(' + value + ', ' + type.substr(1) + ')'; } else { return value; } @@ -768,8 +769,11 @@ function JSify(data, functionsOnly, givenTypes, givenFunctions, givenGlobalVaria } if (GUARD_SIGNS) { if (op[0] == 'u' || (variant && variant[0] == 'u')) { - ident1 = makeUnSign(ident1, type); - ident2 = makeUnSign(ident2, type); + ident1 = makeSignOp(ident1, type, 'un'); + ident2 = makeSignOp(ident2, type, 'un'); + } else if (op[0] == 's' || (variant && variant[0] == 's')) { + ident1 = makeSignOp(ident1, type, 're'); + ident2 = makeSignOp(ident2, type, 're'); } } var bits = null; |