From 4a379c3dd8caeb265d0cb7dae347a0456ce85d84 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Sat, 13 Jan 2018 00:22:00 +0000 Subject: [WebAssembly] Use ArrayRef over raw pointers Differential Revision: https://reviews.llvm.org/D42013 llvm-svn: 322423 --- lld/wasm/Writer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lld/wasm/Writer.cpp') 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(Signature, CtorFunctionBody); + ArrayRef BodyArray( + reinterpret_cast(CtorFunctionBody.data()), + CtorFunctionBody.size()); + CtorFunction = llvm::make_unique(Signature, BodyArray); DefinedFunctions.emplace_back(CtorFunction.get()); } -- cgit v1.2.3