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

Unified Diff: src/wasm/decoder.h

Issue 2657463003: [wasm] Errors in names section do not fail the whole module. (Closed)
Patch Set: Added a TODO 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 | « no previous file | src/wasm/module-decoder.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 bee39d5226a719e7283513c39104d1a4cf90c288..afe8701779300f7251f6dcbecd450e1933500841 100644
--- a/src/wasm/decoder.h
+++ b/src/wasm/decoder.h
@@ -37,6 +37,12 @@ class Decoder {
end_(end),
error_pc_(nullptr),
error_pt_(nullptr) {}
+ Decoder(const byte* start, const byte* pc, const byte* end)
+ : start_(start),
+ pc_(pc),
+ end_(end),
+ error_pc_(nullptr),
+ error_pt_(nullptr) {}
virtual ~Decoder() {}
@@ -184,8 +190,13 @@ class Decoder {
// Consume {size} bytes and send them to the bit bucket, advancing {pc_}.
void consume_bytes(uint32_t size, const char* name = "skip") {
- TRACE(" +%d %-20s: %d bytes\n", static_cast<int>(pc_ - start_), name,
- size);
+#if DEBUG
+ if (name) {
+ // Only trace if the name is not null.
+ TRACE(" +%d %-20s: %d bytes\n", static_cast<int>(pc_ - start_), name,
+ size);
+ }
+#endif
if (checkAvailable(size)) {
pc_ += size;
} else {
« no previous file with comments | « no previous file | src/wasm/module-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698