summaryrefslogtreecommitdiff
path: root/src/emscripten-optimizer
diff options
context:
space:
mode:
Diffstat (limited to 'src/emscripten-optimizer')
-rw-r--r--src/emscripten-optimizer/optimizer-shared.cpp8
-rw-r--r--src/emscripten-optimizer/optimizer.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/emscripten-optimizer/optimizer-shared.cpp b/src/emscripten-optimizer/optimizer-shared.cpp
index ae346d756..e37408b19 100644
--- a/src/emscripten-optimizer/optimizer-shared.cpp
+++ b/src/emscripten-optimizer/optimizer-shared.cpp
@@ -129,7 +129,7 @@ static void abort_on(Ref node) {
abort();
}
-AsmSign detectSign(Ref node) {
+AsmSign detectSign(Ref node, IString minifiedFround) {
IString type = node[0]->getIString();
if (type == BINARY) {
IString op = node[1]->getIString();
@@ -160,11 +160,11 @@ AsmSign detectSign(Ref node) {
} else if (type == NAME) {
return ASM_FLEXIBLE;
} else if (type == CONDITIONAL) {
- return detectSign(node[2]);
+ return detectSign(node[2], minifiedFround);
} else if (type == CALL) {
- if (node[1][0] == NAME && node[1][1] == MATH_FROUND) return ASM_NONSIGNED;
+ if (node[1][0] == NAME && (node[1][1] == MATH_FROUND || node[1][1] == minifiedFround)) return ASM_NONSIGNED;
} else if (type == SEQ) {
- return detectSign(node[2]);
+ return detectSign(node[2], minifiedFround);
}
abort_on(node);
abort(); // avoid warning
diff --git a/src/emscripten-optimizer/optimizer.h b/src/emscripten-optimizer/optimizer.h
index fe1c18770..4720909a5 100644
--- a/src/emscripten-optimizer/optimizer.h
+++ b/src/emscripten-optimizer/optimizer.h
@@ -130,7 +130,7 @@ enum AsmSign {
ASM_NONSIGNED = 3,
};
-extern AsmSign detectSign(cashew::Ref node);
+extern AsmSign detectSign(cashew::Ref node, cashew::IString minifiedFround);
#endif // __optimizer_h__