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

Unified Diff: src/wasm/decoder.h

Issue 1872203005: Fix printf formats (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix unused param found by GC mole 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 | « src/utils.h ('k') | src/wasm/wasm-result.h » ('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 f9de2e1143fb71451a7e7bbbd04f9d30190dfd90..685f5d0bbf5ec5d7bfa53df55f21bb35a7a457b7 100644
--- a/src/wasm/decoder.h
+++ b/src/wasm/decoder.h
@@ -5,9 +5,11 @@
#ifndef V8_WASM_DECODER_H_
#define V8_WASM_DECODER_H_
+#include "src/base/compiler-specific.h"
#include "src/base/smart-pointers.h"
#include "src/flags.h"
#include "src/signature.h"
+#include "src/utils.h"
#include "src/wasm/wasm-result.h"
#include "src/zone-containers.h"
@@ -47,7 +49,7 @@ class Decoder {
inline bool check(const byte* base, int offset, int length, const char* msg) {
DCHECK_GE(base, start_);
if ((base + offset + length) > limit_) {
- error(base, base + offset, msg);
+ error(base, base + offset, "%s", msg);
return false;
}
return true;
@@ -258,12 +260,13 @@ class Decoder {
}
}
- void error(const char* msg) { error(pc_, nullptr, msg); }
+ void error(const char* msg) { error(pc_, nullptr, "%s", msg); }
- void error(const byte* pc, const char* msg) { error(pc, nullptr, msg); }
+ void error(const byte* pc, const char* msg) { error(pc, nullptr, "%s", msg); }
// Sets internal error state.
- void error(const byte* pc, const byte* pt, const char* format, ...) {
+ void PRINTF_FORMAT(4, 5)
+ error(const byte* pc, const byte* pt, const char* format, ...) {
if (ok()) {
#if DEBUG
if (FLAG_wasm_break_on_decoder_error) {
@@ -392,7 +395,7 @@ class Decoder {
return 0;
}
if ((b & 0x80) != 0) {
- error(base, ptr, msg);
+ error(base, ptr, "%s", msg);
return 0;
}
}
« no previous file with comments | « src/utils.h ('k') | src/wasm/wasm-result.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698