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

Unified Diff: src/wasm/decoder.h

Issue 1781523002: [wasm] All strings are length-prefixed and inline (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: comment Created 4 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/compiler/wasm-compiler.cc ('k') | src/wasm/encoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/decoder.h
diff --git a/src/wasm/decoder.h b/src/wasm/decoder.h
index 0ca4e47f7525f059820ddc73eb017e821cbce8a9..098c3306da05b0f750a1cc4fb043277b852777d1 100644
--- a/src/wasm/decoder.h
+++ b/src/wasm/decoder.h
@@ -225,6 +225,8 @@ class Decoder {
*length = static_cast<int>(pc_ - pos);
if (pc_ == end && (b & 0x80)) {
error(pc_ - 1, "varint too large");
+ } else if (*length == 0) {
+ error(pc_, "varint of length 0");
} else {
TRACE("= %u\n", result);
}
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/wasm/encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698