[LLVM-C] Use NameLen in LLVMGetNamedGlobalAlias
authorJakob Bornecrantz <jakob@collabora.com>
Wed, 19 Jan 2022 16:48:28 +0000 (08:48 -0800)
committerArthur Eubanks <aeubanks@google.com>
Wed, 19 Jan 2022 16:58:57 +0000 (08:58 -0800)
I tried to look over the file and didn't see any other non-use of *Len variables.

Reviewed By: deadalnix

Differential Revision: https://reviews.llvm.org/D116482

llvm/lib/IR/Core.cpp

index 85271dd..9415e35 100644 (file)
@@ -2293,7 +2293,7 @@ LLVMValueRef LLVMAddAlias2(LLVMModuleRef M, LLVMTypeRef ValueTy,
 
 LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M,
                                      const char *Name, size_t NameLen) {
-  return wrap(unwrap(M)->getNamedAlias(Name));
+  return wrap(unwrap(M)->getNamedAlias(StringRef(Name, NameLen)));
 }
 
 LLVMValueRef LLVMGetFirstGlobalAlias(LLVMModuleRef M) {