summaryrefslogtreecommitdiff
path: root/src/asmjs/shared-constants.cpp
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@gmail.com>2018-03-16 12:25:47 -0400
committerAlon Zakai <alonzakai@gmail.com>2018-03-16 09:25:47 -0700
commit8fd854d6f60c6c711c3c04e1d30c74a6b2f1821b (patch)
tree85f62151664890b4c29f5109c956bb08241e983f /src/asmjs/shared-constants.cpp
parent8faa79c0dafe2c358a7949910bb1a225a3b32ede (diff)
downloadbinaryen-8fd854d6f60c6c711c3c04e1d30c74a6b2f1821b.tar.gz
binaryen-8fd854d6f60c6c711c3c04e1d30c74a6b2f1821b.tar.bz2
binaryen-8fd854d6f60c6c711c3c04e1d30c74a6b2f1821b.zip
create Math_{min,max} variables for wasm2asm-generated JS (#1476)
We were using Math_{min,max} in wasm2asm-generated files without declaring said functions. This decision created problems for tests, because Math_min (resp. max) would first be used on f32s, thus returning f32, and then validation would fail when it was used on f64s. The resulting changes make wasm2asm tests pass with MOZJS asm.js validation, which moves #1443 forward.
Diffstat (limited to 'src/asmjs/shared-constants.cpp')
-rw-r--r--src/asmjs/shared-constants.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/asmjs/shared-constants.cpp b/src/asmjs/shared-constants.cpp
index 09452805c..c6efe64f9 100644
--- a/src/asmjs/shared-constants.cpp
+++ b/src/asmjs/shared-constants.cpp
@@ -40,6 +40,8 @@ cashew::IString GLOBAL("global"),
CLZ32("clz32"),
FROUND("fround"),
ASM2WASM("asm2wasm"),
+ MIN("min"),
+ MAX("max"),
F64_REM("f64-rem"),
F64_TO_INT("f64-to-int"),
F64_TO_UINT("f64-to-uint"),