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

Unified Diff: src/wasm/ast-decoder.cc

Issue 1860103002: [wasm] Local decl parsing tweak. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/ast-decoder.cc
diff --git a/src/wasm/ast-decoder.cc b/src/wasm/ast-decoder.cc
index e2f6a046b36d59acefe8f28b3650e6c377c4ebf4..0d0c6e0fb0f3e83433895e408b02ee0a376cc938 100644
--- a/src/wasm/ast-decoder.cc
+++ b/src/wasm/ast-decoder.cc
@@ -416,7 +416,6 @@ class SR_WasmDecoder : public WasmDecoder {
DecodeLocalDecls();
if (failed()) return false;
decls.decls_encoded_size = pc_offset();
- decls.total_local_count = 0;
decls.local_types.reserve(local_type_vec_.size());
for (size_t pos = 0; pos < local_type_vec_.size();) {
uint32_t count = 0;
@@ -425,9 +424,9 @@ class SR_WasmDecoder : public WasmDecoder {
pos++;
count++;
}
- decls.total_local_count += count;
decls.local_types.push_back(std::pair<LocalType, uint32_t>(type, count));
}
+ decls.total_local_count = static_cast<uint32_t>(local_type_vec_.size());
return true;
}
« no previous file with comments | « no previous file | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698