aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-01-28 11:53:24 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-01-28 11:53:24 -0800
commitb1931242e88943e14d733664628b475a4a6da12b (patch)
tree0f9dd0314cac7901e2466a65b57f095b9d08a0ee
parent7fd3f046471f28722998764f1db644e2e05882fc (diff)
when legalizing into an i64 mode 1, add artificial params to keep the input variables alive
-rw-r--r--src/analyzer.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index a2ddc7d9..67c6aabf 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -348,7 +348,15 @@ function analyzer(data, sidePass) {
var legalValue;
if (targetBits == 64 && I64_MODE == 1) {
// Generate an i64-1 [low,high]. This will be unnecessary when we legalize i64s
- legalValue = { intertype: 'value', ident: '[' + targetElements[0].ident + ',' + targetElements[1].ident + ']', type: 'rawJS' };
+ legalValue = {
+ intertype: 'value',
+ ident: '[' + targetElements[0].ident + ',' + targetElements[1].ident + ']',
+ type: 'rawJS',
+ // Add the target elements as params so that they are not eliminated as unneeded (the ident is not a simple ident here)
+ params: targetElements.map(function(element) {
+ return { intertype: 'value', ident: element.ident, type: 'i32' };
+ })
+ };
} else if (targetBits <= 32) {
legalValue = { intertype: 'value', ident: targetElements[0].ident, type: 'rawJS' };
// truncation to smaller than 32 bits has already been done, if necessary