diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-02-28 11:00:34 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-28 11:00:34 -0800 |
commit | 9607b1b7692edad2fe379ade5ee146132fa5f0d7 (patch) | |
tree | 015b2cfc97e482750ad436541e69a687330dbb76 /src | |
parent | 6df76ac7cffc27ed181f26b40b63676bfecb78b2 (diff) | |
download | binaryen-9607b1b7692edad2fe379ade5ee146132fa5f0d7.tar.gz binaryen-9607b1b7692edad2fe379ade5ee146132fa5f0d7.tar.bz2 binaryen-9607b1b7692edad2fe379ade5ee146132fa5f0d7.zip |
asm2wasm import overloading fix (#924)
* asm2wasm should not promote an overloaded import result to f64 if it is a single type and void
Diffstat (limited to 'src')
-rw-r--r-- | src/asm2wasm.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index ccbf91c70..b952521ae 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -418,9 +418,10 @@ private: previous->params.push_back(type->params[i]); // add a new param } } + // we accept none and a concrete type, but two concrete types mean we need to use an f64 to contain anything if (previous->result == none) { previous->result = type->result; // use a more concrete type - } else if (previous->result != type->result) { + } else if (previous->result != type->result && type->result != none) { previous->result = f64; // overloaded return type, make it a double } } |