diff options
-rw-r--r-- | src/parseTools.js | 2 | ||||
-rw-r--r-- | src/runtime.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index e73f6140..5f8797b0 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -1250,7 +1250,7 @@ function makeSetValues(ptr, pos, value, type, num, align) { // If we don't know how to handle this at compile-time, or handling it is best done in a large amount of code, call memset // TODO: optimize the case of numeric num but non-numeric value if (!isNumber(num) || !isNumber(value) || (align < 4 && parseInt(num) >= SEEK_OPTIMAL_ALIGN_MIN)) { - return '_memset(' + getFastValue(ptr, '+', pos) + ', ' + value + ', ' + num + ', ' + align + ')'; + return '_memset(' + asmCoercion(getFastValue(ptr, '+', pos), 'i32') + ', ' + asmCoercion(value, 'i32') + ', ' + asmCoercion(num, 'i32') + ', ' + align + ')'; } num = parseInt(num); value = parseInt(value); diff --git a/src/runtime.js b/src/runtime.js index d1475bd4..feeeca38 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -46,7 +46,7 @@ var RuntimeGenerator = { ret += '; assert(STACKTOP < STACK_MAX)'; } if (INIT_STACK) { - ret += '; _memset(__stackBase__, 0, ' + initial + ')'; + ret += '; _memset(' + asmCoercion('__stackBase__', 'i32') + ', 0, ' + initial + ')'; } return ret; }, |