Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(569)

Unified Diff: src/wasm/wasm-module-builder.cc

Issue 2771183002: [wasm][asm.js] Fix and enable several asm.js tests with the new parser. (Closed)
Patch Set: fix one more item Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | test/mjsunit/asm/asm-validation.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-module-builder.cc
diff --git a/src/wasm/wasm-module-builder.cc b/src/wasm/wasm-module-builder.cc
index b1b859ba42cbd9c0d63b2c0950869760a7f8b42b..73f68e891f6b5a5c457b10ff97cbe92340dd7b11 100644
--- a/src/wasm/wasm-module-builder.cc
+++ b/src/wasm/wasm-module-builder.cc
@@ -190,9 +190,10 @@ void WasmFunctionBuilder::StashCode(std::vector<byte>* dst, size_t position) {
body_.resize(position);
return;
}
+ DCHECK_LE(position, body_.size());
size_t len = body_.size() - position;
dst->resize(len);
- memcpy(dst->data(), &body_[position], len);
+ memcpy(dst->data(), body_.data() + position, len);
body_.resize(position);
}
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | test/mjsunit/asm/asm-validation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698