aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-11-11 10:59:18 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-11-11 10:59:18 -0800
commit9d006256df96e6d81bf869958af28643720f14db (patch)
tree390f01f4f4ddb8e19c5899415644009337206ce6 /src/parseTools.js
parentfa0443ee8ef4306ee2bf848a6c18d189bafbac77 (diff)
coerce to double before converting a float to an i64
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index adb3f6e4..e806c861 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -2259,7 +2259,7 @@ function processMathop(item) {
throw 'shifts should have been legalized!';
}
case 'uitofp': case 'sitofp': return makeFloat(RuntimeGenerator.makeBigInt(low1, high1, op[0] == 'u'), item.type);
- case 'fptoui': case 'fptosi': return finish(splitI64(idents[0], true));
+ case 'fptoui': case 'fptosi': return finish(splitI64(asmCoercion(idents[0], 'double'), true)); // coerce to double before conversion to i64
case 'icmp': {
switch (variant) {
case 'uge': return '((' + high1 + '>>>0) >= (' + high2 + '>>>0)) & ((((' + high1 + '>>>0) > (' + high2 + '>>>0)) | ' +