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

Unified Diff: test/cctest/wasm/wasm-run-utils.h

Issue 2636463002: Revert of [wasm] Enforce that function bodies end with the \"end\" opcode. (Closed)
Patch Set: Created 3 years, 11 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 | « test/cctest/wasm/test-wasm-breakpoints.cc ('k') | test/debugger/debug/wasm/frame-inspection.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/wasm-run-utils.h
diff --git a/test/cctest/wasm/wasm-run-utils.h b/test/cctest/wasm/wasm-run-utils.h
index f85f4ca3e2ccec4cd5bdde5371e9128d69c366e6..533fab41b921da5f0d090857fc9be4b23b546e49 100644
--- a/test/cctest/wasm/wasm-run-utils.h
+++ b/test/cctest/wasm/wasm-run-utils.h
@@ -509,18 +509,7 @@
uint32_t function_index() { return function_->func_index; }
void Build(const byte* start, const byte* end) {
- size_t locals_size = local_decls.Size();
- size_t total_size = end - start + locals_size + 1;
- byte* buffer = static_cast<byte*>(zone()->New(total_size));
- // Prepend the local decls to the code.
- local_decls.Emit(buffer);
- // Emit the code.
- memcpy(buffer + locals_size, start, end - start);
- // Append an extra end opcode.
- buffer[total_size - 1] = kExprEnd;
-
- start = buffer;
- end = buffer + total_size;
+ local_decls.Prepend(zone(), &start, &end);
CHECK_GE(kMaxInt, end - start);
int len = static_cast<int>(end - start);
« no previous file with comments | « test/cctest/wasm/test-wasm-breakpoints.cc ('k') | test/debugger/debug/wasm/frame-inspection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698