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

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

Issue 2487673004: [wasm] Fix -Wsign-compare warnings. (Closed)
Patch Set: address comments Created 4 years, 1 month 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/asmjs/asm-typer.cc ('k') | src/wasm/wasm-module.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 a2d0a3f0dea04fc42bdb79dda0fadcd0588ca982..af436f96debe25d259232cebee592174549cd3ff 100644
--- a/src/wasm/ast-decoder.cc
+++ b/src/wasm/ast-decoder.cc
@@ -800,7 +800,8 @@ class WasmFullDecoder : public WasmDecoder {
if (c->false_env != nullptr) {
// End the true branch of a one-armed if.
Goto(c->false_env, c->end_env);
- if (ssa_env_->go() && stack_.size() != c->stack_depth) {
+ if (ssa_env_->go() &&
+ static_cast<int>(stack_.size()) != c->stack_depth) {
error("end of if expected empty stack");
stack_.resize(c->stack_depth);
}
@@ -1435,7 +1436,7 @@ class WasmFullDecoder : public WasmDecoder {
// Unreachable code is essentially not typechecked.
return {pc_, nullptr, kAstEnd};
}
- if (stack_depth == stack_.size()) {
+ if (stack_depth == static_cast<int>(stack_.size())) {
Value val = {pc_, nullptr, kAstStmt};
return val;
} else {
@@ -1460,8 +1461,7 @@ class WasmFullDecoder : public WasmDecoder {
Goto(ssa_env_, c->end_env);
} else {
// Merge the value(s) into the end of the block.
- if (static_cast<size_t>(c->stack_depth + c->merge.arity) >
- stack_.size()) {
+ if (c->stack_depth + c->merge.arity > stack_.size()) {
error(
pc_, pc_,
"expected at least %d values on the stack for br to @%d, found %d",
@@ -1477,7 +1477,7 @@ class WasmFullDecoder : public WasmDecoder {
if (!ssa_env_->go()) return;
// Merge the value(s) into the end of the block.
int arity = static_cast<int>(c->merge.arity);
- if (c->stack_depth + arity != stack_.size()) {
+ if (c->stack_depth + arity != static_cast<int>(stack_.size())) {
error(pc_, pc_, "expected %d elements on the stack for fallthru to @%d",
arity, startrel(c->pc));
return;
@@ -1493,7 +1493,7 @@ class WasmFullDecoder : public WasmDecoder {
if (!ssa_env_->go()) return;
// Fallthru must match arity exactly.
int arity = static_cast<int>(c->merge.arity);
- if (c->stack_depth + arity != stack_.size()) {
+ if (c->stack_depth + arity != static_cast<int>(stack_.size())) {
error(pc_, pc_, "expected %d elements on the stack for fallthru to @%d",
arity, startrel(c->pc));
return;
« no previous file with comments | « src/asmjs/asm-typer.cc ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698