aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-14 15:57:11 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-14 15:57:11 -0800
commitb3fede1b70fee4b5fc23f7aeafef5eefb22104fc (patch)
tree7630782910d415355ea61d402817845573ef2b15 /src
parent3b0fa1af3a8f97ea1890e24be39805d1a9a06ee8 (diff)
fix atomics for asm
Diffstat (limited to 'src')
-rw-r--r--src/jsifier.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 1501c04d..3f0bc4fe 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1193,7 +1193,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, ',') + ')),tempValue)';
+ return '(tempValue=' + makeGetValue(param1, 0, type) + ',(' + makeGetValue(param1, 0, type) + '==' + param2 + ' ? ' + makeSetValue(param1, 0, param3, type, null, null, null, null, ',') + ' : 0),tempValue)';
}
default: throw 'unhandled atomic op: ' + item.op;
}