Commit 273bb58c authored by mtrofin's avatar mtrofin Committed by Commit bot

[wasm] memory size is an uint32_t, not a size_t.

BUG=

Review-Url: https://codereview.chromium.org/2077623002
Cr-Commit-Position: refs/heads/master@{#37044}
parent 67101597
......@@ -2578,7 +2578,7 @@ void WasmGraphBuilder::BoundsCheckMem(MachineType memtype, Node* index,
uint32_t offset,
wasm::WasmCodePosition position) {
DCHECK(module_ && module_->instance);
size_t size = module_->instance->mem_size;
uint32_t size = module_->instance->mem_size;
byte memsize = wasm::WasmOpcodes::MemSize(memtype);
// Check against the effective size.
......
......@@ -225,7 +225,7 @@ struct WasmModuleInstance {
std::vector<Handle<Code>> import_code; // code objects for each import.
// -- raw memory ------------------------------------------------------------
byte* mem_start; // start of linear memory.
size_t mem_size; // size of the linear memory.
uint32_t mem_size; // size of the linear memory.
// -- raw globals -----------------------------------------------------------
byte* globals_start; // start of the globals area.
......
This diff is collapsed.
......@@ -96,7 +96,7 @@ class TestingModule : public ModuleEnv {
if (interpreter_) delete interpreter_;
}
byte* AddMemory(size_t size) {
byte* AddMemory(uint32_t size) {
CHECK_NULL(instance->mem_start);
CHECK_EQ(0, instance->mem_size);
instance->mem_start = reinterpret_cast<byte*>(malloc(size));
......@@ -107,7 +107,7 @@ class TestingModule : public ModuleEnv {
}
template <typename T>
T* AddMemoryElems(size_t count) {
T* AddMemoryElems(uint32_t count) {
AddMemory(count * sizeof(T));
return raw_mem_start<T>();
}
......
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