diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-09-23 20:34:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-23 20:34:56 -0700 |
commit | b6469ed600832887e8874d1a0407b993dd2c03e8 (patch) | |
tree | 325cafc1625265a8d7569a4f2b2a45910e4040fb /src/asm2wasm.h | |
parent | dc82f588309f1a4413be18460159699df74661c4 (diff) | |
parent | 7d5180a5b3e369634dbc1442117068d332d71049 (diff) | |
download | binaryen-b6469ed600832887e8874d1a0407b993dd2c03e8.tar.gz binaryen-b6469ed600832887e8874d1a0407b993dd2c03e8.tar.bz2 binaryen-b6469ed600832887e8874d1a0407b993dd2c03e8.zip |
Merge pull request #710 from WebAssembly/autodrop-fix
Autodrop fixes
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; } |