diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-09-23 15:14:34 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-09-23 15:30:42 -0700 |
commit | 8f897c7d5543fd1529b8279801ddbb59ffff7f1b (patch) | |
tree | d7432148e785c9fe7117a966469c15b7879186f1 /src/asm2wasm.h | |
parent | 44978317c4068cea4778e264d03efb5537c009ea (diff) | |
download | binaryen-8f897c7d5543fd1529b8279801ddbb59ffff7f1b.tar.gz binaryen-8f897c7d5543fd1529b8279801ddbb59ffff7f1b.tar.bz2 binaryen-8f897c7d5543fd1529b8279801ddbb59ffff7f1b.zip |
autoDrop fix
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r-- | src/asm2wasm.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index 1c528d7f3..e926e381f 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -797,13 +797,17 @@ void Asm2WasmBuilder::processAsm(Ref ast) { switch (curr->type) { case i32: replaceCurrent(parent->builder.makeUnary(TruncSFloat64ToInt32, curr)); break; case f32: replaceCurrent(parent->builder.makeUnary(DemoteFloat64, curr)); break; - case none: replaceCurrent(parent->builder.makeDrop(curr)); break; + case none: { + // this function returns a value, but we are not using it, so it must be dropped. + // autodrop will do that for us. + break; + } default: WASM_UNREACHABLE(); } } else { assert(curr->type == none); // we don't want a return value here, but the import does provide one - replaceCurrent(parent->builder.makeDrop(curr)); + // autodrop will do that for us. } curr->type = importResult; } |