summaryrefslogtreecommitdiff
path: root/src/wasm-validator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-validator.h')
-rw-r--r--src/wasm-validator.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h
index 73aa7fecf..ca168e48b 100644
--- a/src/wasm-validator.h
+++ b/src/wasm-validator.h
@@ -87,9 +87,9 @@ public:
void visitMemory(Memory *curr) {
shouldBeFalse(curr->initial > curr->max);
size_t top = 0;
- for (auto segment : curr->segments) {
+ for (auto& segment : curr->segments) {
shouldBeFalse(segment.offset < top);
- top = segment.offset + segment.size;
+ top = segment.offset + segment.data.size();
}
shouldBeFalse(top > curr->initial);
}