aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-29 16:12:19 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-03 15:31:04 -0700
commitef9e8676075023a3b0cb0b503d29856ae5017fbc (patch)
treeba3d89b648f4c7e0c524d3fa2d9346254f999ac2
parent549f104a5ce0dc96651d4ae3985d4357696dacdd (diff)
coerce in cmpxchg
-rw-r--r--src/jsifier.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 8c2e755e..dbba8e25 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1272,7 +1272,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 + '|0) ? ' + makeSetValue(param1, 0, param3, type, null, null, null, null, ',') + ' : 0),tempValue)';
+ return '(tempValue=' + makeGetValue(param1, 0, type) + ',(' + makeGetValue(param1, 0, type) + '==(' + param2 + '|0) ? ' + asmCoercion(makeSetValue(param1, 0, param3, type, null, null, null, null, ','), 'i32') + ' : 0),tempValue)';
}
default: throw 'unhandled atomic op: ' + item.op;
}