Commit 2974148d authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[gcc] Fix gcc warnings in wasm decoder

gcc warns against passing a nullptr to a printf '%s' string print, and
the default args of varint consuming functions in the wasm decoder were
providing a null name.

Bug: chromium:1307180
Change-Id: I7a4e7a38119c2568025a597423d391a7c2c573f2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3735123
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81441}
parent 7a158c31
......@@ -198,7 +198,7 @@ class Decoder {
}
// Reads a LEB128 variable-length unsigned 32-bit integer and advances {pc_}.
uint32_t consume_u32v(const char* name = nullptr) {
uint32_t consume_u32v(const char* name = "var_uint32") {
uint32_t length = 0;
uint32_t result =
read_leb<uint32_t, kFullValidation, kTrace>(pc_, &length, name);
......@@ -207,7 +207,7 @@ class Decoder {
}
// Reads a LEB128 variable-length signed 32-bit integer and advances {pc_}.
int32_t consume_i32v(const char* name = nullptr) {
int32_t consume_i32v(const char* name = "var_int32") {
uint32_t length = 0;
int32_t result =
read_leb<int32_t, kFullValidation, kTrace>(pc_, &length, name);
......@@ -216,7 +216,7 @@ class Decoder {
}
// Reads a LEB128 variable-length unsigned 64-bit integer and advances {pc_}.
uint64_t consume_u64v(const char* name = nullptr) {
uint64_t consume_u64v(const char* name = "var_uint64") {
uint32_t length = 0;
uint64_t result =
read_leb<uint64_t, kFullValidation, kTrace>(pc_, &length, name);
......@@ -225,7 +225,7 @@ class Decoder {
}
// Reads a LEB128 variable-length signed 64-bit integer and advances {pc_}.
int64_t consume_i64v(const char* name = nullptr) {
int64_t consume_i64v(const char* name = "var_int64") {
uint32_t length = 0;
int64_t result =
read_leb<int64_t, kFullValidation, kTrace>(pc_, &length, name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment