diff options
author | Alon Zakai <alonzakai@gmail.com> | 2019-03-29 17:45:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-29 17:45:42 -0700 |
commit | d2ce12f1315bf38df34edfef86701d4bc4f0db35 (patch) | |
tree | 736e92ca9f0272b60e10cd93e31c6449fdb68e2d /src | |
parent | f44c56c961724312224a13e209b3b6db39ad9d77 (diff) | |
download | binaryen-d2ce12f1315bf38df34edfef86701d4bc4f0db35.tar.gz binaryen-d2ce12f1315bf38df34edfef86701d4bc4f0db35.tar.bz2 binaryen-d2ce12f1315bf38df34edfef86701d4bc4f0db35.zip |
avoid risky iterator addition (#1970)
Not an actual problem, but hits an assertion in D_GLIBCXX_DEBUG, and is likely UB.
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm/wasm-binary.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index 02987f5f7..18bd48e2a 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -394,7 +394,7 @@ void WasmBinaryWriter::writeDataSegments() { if (combined.data.size() < needed) { combined.data.resize(needed); } - std::copy(segment.data.begin(), segment.data.end(), combined.data.begin() + offset - start); + std::copy(segment.data.begin(), segment.data.end(), combined.data.begin() + (offset - start)); } emit(combined); break; |