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

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

Issue 1533593004: Fix several wasm warnings an a use after free. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years 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 | src/wasm/ast-decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/ast-decoder.h
diff --git a/src/wasm/ast-decoder.h b/src/wasm/ast-decoder.h
index f0b14117fe12548f5b8dbe3c6475047919f9cf8c..5b95ad9f870a93bbab3e54142a04dc9fe35bbafc 100644
--- a/src/wasm/ast-decoder.h
+++ b/src/wasm/ast-decoder.h
@@ -35,8 +35,10 @@ struct FunctionEnv {
bool IsValidLocal(uint32_t index) { return index < total_locals; }
uint32_t GetLocalCount() { return total_locals; }
LocalType GetLocalType(uint32_t index) {
- if (index < sig->parameter_count()) return sig->GetParam(index);
- index -= sig->parameter_count();
+ if (index < static_cast<uint32_t>(sig->parameter_count())) {
+ return sig->GetParam(index);
+ }
+ index -= static_cast<uint32_t>(sig->parameter_count());
if (index < local_int32_count) return kAstI32;
index -= local_int32_count;
if (index < local_int64_count) return kAstI64;
« no previous file with comments | « no previous file | src/wasm/ast-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698