aboutsummaryrefslogtreecommitdiff
path: root/src/analyzer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-12 11:23:09 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-12 11:23:31 -0700
commitdef22b8d534168bef164f958028bcb17d3ad23aa (patch)
treecec9561e777fda5bec428637b99a247b2e001128 /src/analyzer.js
parent846fb98f0ac29dc556c80b606ce7e6e9c1c8afae (diff)
legalize add etc. of < 32-bit illegal values properly; fixes #1505
Diffstat (limited to 'src/analyzer.js')
-rw-r--r--src/analyzer.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index 1a752305..931ce421 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -765,7 +765,15 @@ function analyzer(data, sidePass) {
}
break;
}
- case 'add': case 'sub': case 'sdiv': case 'udiv': case 'mul': case 'urem': case 'srem':
+ case 'add': case 'sub': case 'sdiv': case 'udiv': case 'mul': case 'urem': case 'srem': {
+ if (sourceBits < 32) {
+ // when we add illegal types like i24, we must work on the singleton chunks
+ item.assignTo += '$0';
+ item.params[0].ident += '$0';
+ item.params[1].ident += '$0';
+ }
+ // fall through
+ }
case 'uitofp': case 'sitofp': case 'fptosi': case 'fptoui': {
// We cannot do these in parallel chunks of 32-bit operations. We will handle these in processMathop
i++;