| Index: src/wasm/wasm-module.h
|
| diff --git a/src/wasm/wasm-module.h b/src/wasm/wasm-module.h
|
| index 78b780ace04bb5b87898cf301f771a8f6aaa29ac..59cf7e3ac02de8e936b6655fea9dcdd2f6f43fb0 100644
|
| --- a/src/wasm/wasm-module.h
|
| +++ b/src/wasm/wasm-module.h
|
| @@ -190,17 +190,21 @@ struct WasmModule {
|
| WasmModule();
|
|
|
| // Get a string stored in the module bytes representing a name.
|
| - WasmName GetName(uint32_t offset, uint32_t length) const {
|
| + Vector<const char> GetName(uint32_t offset, uint32_t length) const {
|
| if (length == 0) return {"<?>", 3}; // no name.
|
| CHECK(BoundsCheck(offset, offset + length));
|
| - return {reinterpret_cast<const char*>(module_start + offset), length};
|
| + DCHECK_EQ(static_cast<int64_t>(length), static_cast<int>(length));
|
| + return {reinterpret_cast<const char*>(module_start + offset),
|
| + static_cast<int>(length)};
|
| }
|
|
|
| // Get a string stored in the module bytes representing a name.
|
| - WasmName GetNameOrNull(uint32_t offset, uint32_t length) const {
|
| + Vector<const char> GetNameOrNull(uint32_t offset, uint32_t length) const {
|
| if (length == 0) return {NULL, 0}; // no name.
|
| CHECK(BoundsCheck(offset, offset + length));
|
| - return {reinterpret_cast<const char*>(module_start + offset), length};
|
| + DCHECK_EQ(static_cast<int64_t>(length), static_cast<int>(length));
|
| + return {reinterpret_cast<const char*>(module_start + offset),
|
| + static_cast<int>(length)};
|
| }
|
|
|
| // Checks the given offset range is contained within the module bytes.
|
|
|