diff options
author | Nathan Froyd <froydnj@gmail.com> | 2018-03-16 12:25:47 -0400 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2018-03-16 09:25:47 -0700 |
commit | 8fd854d6f60c6c711c3c04e1d30c74a6b2f1821b (patch) | |
tree | 85f62151664890b4c29f5109c956bb08241e983f /test/empty_table.2asm.js | |
parent | 8faa79c0dafe2c358a7949910bb1a225a3b32ede (diff) | |
download | binaryen-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 'test/empty_table.2asm.js')
-rw-r--r-- | test/empty_table.2asm.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/empty_table.2asm.js b/test/empty_table.2asm.js index a303b9d06..3a209950b 100644 --- a/test/empty_table.2asm.js +++ b/test/empty_table.2asm.js @@ -12,6 +12,8 @@ function asmFunc(global, env, buffer) { var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; var Math_clz32 = global.Math.clz32; + var Math_min = global.Math.min; + var Math_max = global.Math.max; function __wasm_ctz_i32(x) { x = x | 0; var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $10 = 0; |