diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-03-04 10:47:09 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-03-04 10:47:09 -0800 |
commit | 6792da20da77ad24bbce3d1c05b883d25ac0ef4b (patch) | |
tree | 243f333e42309e883f39d9313f5c82c84e98ba28 | |
parent | bbda9eeaf9d1dd4f02f7507902dcbcff188485fb (diff) |
fix cmpxchg for asm
-rw-r--r-- | src/jsifier.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index ca404258..ff58ece2 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1210,7 +1210,7 @@ function JSify(data, functionsOnly, givenFunctions) { case 'xchg': return '(tempValue=' + makeGetValue(param1, 0, type) + ',' + makeSetValue(param1, 0, param2, type, null, null, null, null, ',') + ',tempValue)'; case 'cmpxchg': { var param3 = finalizeLLVMParameter(item.params[2]); - return '(tempValue=' + makeGetValue(param1, 0, type) + ',(' + makeGetValue(param1, 0, type) + '==' + param2 + ' ? ' + makeSetValue(param1, 0, param3, type, null, null, null, null, ',') + ' : 0),tempValue)'; + return '(tempValue=' + makeGetValue(param1, 0, type) + ',(' + makeGetValue(param1, 0, type) + '==(' + param2 + '|0) ? ' + makeSetValue(param1, 0, param3, type, null, null, null, null, ',') + ' : 0),tempValue)'; } default: throw 'unhandled atomic op: ' + item.op; } |