diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp index f94b8a04738f..a3065733c81b 100644 --- a/llvm/lib/IR/Core.cpp +++ b/llvm/lib/IR/Core.cpp @@ -2316,7 +2316,7 @@ const char *LLVMIntrinsicCopyOverloadedName(unsigned ID, ArrayRef Tys(unwrap(ParamTypes), ParamCount); auto Str = llvm::Intrinsic::getName(IID, Tys); *NameLength = Str.length(); - return strndup(Str.c_str(), Str.length()); + return strdup(Str.c_str()); } LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID) {