diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-11-19 21:00:39 +0100 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-11-19 21:00:39 +0100 |
commit | 8bba2b426d62080aa5a6191c48719dd142bebc12 (patch) | |
tree | fad469b95b925b4c8e6e068ce8f92c2969e9c287 /src | |
parent | ff8a2e5c1044e2064b4ede712e37aacac8db6a5b (diff) |
fix separator in atomic ops; fixes #722
Diffstat (limited to 'src')
-rw-r--r-- | src/jsifier.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 6d3fe781..7960115f 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1069,12 +1069,12 @@ function JSify(data, functionsOnly, givenFunctions) { var param1 = finalizeLLVMParameter(item.params[0]); var param2 = finalizeLLVMParameter(item.params[1]); switch (item.op) { - case 'add': return '(tempValue=' + makeGetValue(param1, 0, type) + ',' + makeSetValue(param1, 0, 'tempValue+' + param2, type) + ',tempValue)'; - case 'sub': return '(tempValue=' + makeGetValue(param1, 0, type) + ',' + makeSetValue(param1, 0, 'tempValue-' + param2, type) + ',tempValue)'; - case 'xchg': return '(tempValue=' + makeGetValue(param1, 0, type) + ',' + makeSetValue(param1, 0, param2, type) + ',tempValue)'; + case 'add': return '(tempValue=' + makeGetValue(param1, 0, type) + ',' + makeSetValue(param1, 0, 'tempValue+' + param2, type, null, null, null, null, ',') + ',tempValue)'; + case 'sub': return '(tempValue=' + makeGetValue(param1, 0, type) + ',' + makeSetValue(param1, 0, 'tempValue-' + param2, type, null, null, null, null, ',') + ',tempValue)'; + 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) + ')),tempValue)'; + return '(tempValue=' + makeGetValue(param1, 0, type) + ',(' + makeGetValue(param1, 0, type) + '==' + param2 + ' && (' + makeSetValue(param1, 0, param3, type, null, null, null, null, ',') + ')),tempValue)'; } default: throw 'unhandled atomic op: ' + item.op; } |