summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-01-19 10:31:22 -0800
committerGitHub <noreply@github.com>2017-01-19 10:31:22 -0800
commit665de854468175e9254ed7218fe7dd65bc5bc55e (patch)
tree20ee01593be84c7353ee5e0cba26e7a490ebf986 /src
parenteafc06f8cf2b815d151b67c67086f33b3dae6b8b (diff)
downloadbinaryen-665de854468175e9254ed7218fe7dd65bc5bc55e.tar.gz
binaryen-665de854468175e9254ed7218fe7dd65bc5bc55e.tar.bz2
binaryen-665de854468175e9254ed7218fe7dd65bc5bc55e.zip
handle an unreachable param to an export in asm2wasm, which is ignorable (#885)
Diffstat (limited to 'src')
-rw-r--r--src/asm2wasm.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h
index f7f084376..d8a2053be 100644
--- a/src/asm2wasm.h
+++ b/src/asm2wasm.h
@@ -960,7 +960,9 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
val->type = val->value.type = type->params[i];
curr->operands.push_back(val);
} else if (curr->operands[i]->type != type->params[i]) {
- assert(type->params[i] == f64);
+ // if the param is used, then we have overloading here and the combined type must be f64;
+ // if this is an unreachable param, then it doesn't matter.
+ assert(type->params[i] == f64 || curr->operands[i]->type == unreachable);
// overloaded, upgrade to f64
switch (curr->operands[i]->type) {
case i32: curr->operands[i] = parent->builder.makeUnary(ConvertSInt32ToFloat64, curr->operands[i]); break;