| 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;
|
| }
|
| }
|
|
|