diff options
author | jgravelle-google <jgravelle@google.com> | 2017-04-07 11:35:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-07 11:35:44 -0700 |
commit | 6d617838304dd753bd4eea3b1bc1d38f467d8d37 (patch) | |
tree | 1597829b3cfc3f5fd58708318b24eaf8ca887746 /src | |
parent | 114e4cec95f6b0d1aafd9d7a976b0fb2c0fddc36 (diff) | |
download | binaryen-6d617838304dd753bd4eea3b1bc1d38f467d8d37.tar.gz binaryen-6d617838304dd753bd4eea3b1bc1d38f467d8d37.tar.bz2 binaryen-6d617838304dd753bd4eea3b1bc1d38f467d8d37.zip |
Don't iterate over removed-but-not-erased functions (#961)
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-linker.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wasm-linker.cpp b/src/wasm-linker.cpp index 28fb7c22f..f50ecab7a 100644 --- a/src/wasm-linker.cpp +++ b/src/wasm-linker.cpp @@ -337,7 +337,8 @@ void Linker::emscriptenGlue(std::ostream& o) { } auto functionsToThunk = getTableData(); - std::remove(functionsToThunk.begin(), functionsToThunk.end(), dummyFunction); + auto removeIt = std::remove(functionsToThunk.begin(), functionsToThunk.end(), dummyFunction); + functionsToThunk.erase(removeIt, functionsToThunk.end()); for (auto f : emscripten::makeDynCallThunks(out.wasm, functionsToThunk)) { exportFunction(f->name, true); } |