diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/analyzer.js | 5 | ||||
-rw-r--r-- | src/jsifier.js | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/analyzer.js b/src/analyzer.js index 3fb20253..17ad26ad 100644 --- a/src/analyzer.js +++ b/src/analyzer.js @@ -783,13 +783,14 @@ function analyzer(data, sidePass) { assert(PRECISE_I64_MATH, 'Must have precise i64 math for non-constant 64-bit shifts'); Types.preciseI64MathUsed = 1; value.intertype = 'value'; - value.ident = 'var ' + value.assignTo + '$0 = ' + + value.ident = makeVarDef(value.assignTo) + '$0=' + asmCoercion('_bitshift64' + value.op[0].toUpperCase() + value.op.substr(1) + '(' + asmCoercion(sourceElements[0].ident, 'i32') + ',' + asmCoercion(sourceElements[1].ident, 'i32') + ',' + asmCoercion(value.params[1].ident + '$0', 'i32') + ')', 'i32' ) + ';' + - 'var ' + value.assignTo + '$1 = tempRet0;'; + makeVarDef(value.assignTo) + '$1=tempRet0;'; + value.vars = [[value.assignTo + '$0', 'i32'], [value.assignTo + '$1', 'i32']]; value.assignTo = null; i++; continue; diff --git a/src/jsifier.js b/src/jsifier.js index f9f1d922..8e329f8c 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -904,6 +904,11 @@ function JSify(data, functionsOnly, givenFunctions) { // Function lines function valueHandler(item) { + if (item.vars) { + item.vars.forEach(function(v) { + addVariable(v[0], v[1]); + }); + } return item.ident; } function noopHandler(item) { |