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.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index 91fe91b49..e9845a1fb 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -1550,11 +1550,12 @@ public:
Memory::Segment curr;
auto offset = getU32LEB();
auto size = getU32LEB();
- char buffer[size];
+ std::vector<char> buffer;
+ buffer.resize(size);
for (size_t j = 0; j < size; j++) {
buffer[j] = char(getInt8());
}
- wasm.memory.segments.emplace_back(offset, (const char*)buffer, size);
+ wasm.memory.segments.emplace_back(offset, (const char*)&buffer[0], size);
}
}