Skip to content

Commit 60935df

Browse files
committed
Fix use-after-move
1 parent 2979402 commit 60935df

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Sources/llvmshims/src/shim.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,8 @@ LLVMBinaryType LLVMBinaryGetType(LLVMBinaryRef BR) {
146146
}
147147

148148
LLVMBinaryRef LLVMCreateBinary(LLVMMemoryBufferRef MemBuf, LLVMContextRef Context, char **ErrorMessage) {
149-
std::unique_ptr<llvm::MemoryBuffer> Buf(unwrap(MemBuf));
150149
Expected<std::unique_ptr<Binary>> ObjOrErr(
151-
createBinary(Buf->getMemBufferRef(), unwrap(Context)));
150+
createBinary(unwrap(MemBuf)->getMemBufferRef(), unwrap(Context)));
152151
if (!ObjOrErr) {
153152
*ErrorMessage = strdup(toString(ObjOrErr.takeError()).c_str());
154153
return nullptr;

0 commit comments

Comments
 (0)