summaryrefslogtreecommitdiffstats
path: root/lld/wasm/Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/wasm/Writer.cpp')
-rw-r--r--lld/wasm/Writer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp
index eea5439c2b9..bb34f265d40 100644
--- a/lld/wasm/Writer.cpp
+++ b/lld/wasm/Writer.cpp
@@ -770,8 +770,10 @@ void Writer::createCtorFunction() {
writeUleb128(OS, FunctionBody.size(), "function size");
OS.flush();
CtorFunctionBody += FunctionBody;
- CtorFunction =
- llvm::make_unique<SyntheticFunction>(Signature, CtorFunctionBody);
+ ArrayRef<uint8_t> BodyArray(
+ reinterpret_cast<const uint8_t *>(CtorFunctionBody.data()),
+ CtorFunctionBody.size());
+ CtorFunction = llvm::make_unique<SyntheticFunction>(Signature, BodyArray);
DefinedFunctions.emplace_back(CtorFunction.get());
}
OpenPOWER on IntegriCloud