summaryrefslogtreecommitdiff
path: root/src/wasm-binary.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r--src/wasm-binary.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index f86a19aa8..d2959c69d 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -1187,14 +1187,15 @@ public:
if (debug) std::cerr << "== readDataSegments" << std::endl;
auto num = getLEB128();
for (size_t i = 0; i < num; i++) {
- auto curr = allocator.alloc<Memory::Segment>();
- curr->offset = getInt32();
+ Memory::Segment curr;
+ curr.offset = getInt32();
auto start = getInt32();
auto size = getInt32();
auto buffer = malloc(size);
memcpy(buffer, &input[start], size);
- curr->data = (const char*)buffer;
- curr->size = size;
+ curr.data = (const char*)buffer;
+ curr.size = size;
+ wasm.memory.segments.push_back(curr);
verifyInt8(1); // load at program start
}
}