diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/analyzer.js | 9 | ||||
-rw-r--r-- | src/parseTools.js | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/analyzer.js b/src/analyzer.js index 758d0b59..ece8fd53 100644 --- a/src/analyzer.js +++ b/src/analyzer.js @@ -186,13 +186,14 @@ function analyzer(data, sidePass) { }, lineNum: item.lineNum + (j/100) }); + var actualSizeType = 'i' + element.bits; // The last one may be smaller than 32 bits label.lines.splice(i+j*2+1, 0, { intertype: 'store', - valueType: 'i32', - value: { intertype: 'value', ident: element.ident, type: 'i32' }, - pointer: { intertype: 'value', ident: tempVar, type: 'i32' }, + valueType: actualSizeType, + value: { intertype: 'value', ident: element.ident, type: actualSizeType }, + pointer: { intertype: 'value', ident: tempVar, type: actualSizeType + '*' }, ident: tempVar, - pointerType: 'i32*', + pointerType: actualSizeType + '*', align: item.align, lineNum: item.lineNum + ((j+0.5)/100) }); diff --git a/src/parseTools.js b/src/parseTools.js index 0a246fdd..45cee958 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -605,6 +605,8 @@ function makeCopyI64(value) { function parseArbitraryInt(str, bits) { // We parse the string into a vector of digits, base 10. This is convenient to work on. + assert(('i' + (bits % 32)) in Runtime.INT_TYPES, 'Arbitrary-sized ints must tails that are of legal size'); + function str2vec(s) { // index 0 is the highest value var ret = []; for (var i = 0; i < s.length; i++) { |