Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b889b51

Browse files
committedFeb 1, 2017
Do not pass non-POD type variables through variadic function
Summary: Cannot pass object of non-POD type 'const CMIUtilString' through variadic function. This behavior is undefined according to C++11 5.2.2/7: > Passing a potentially-evaluated argument of class type having a non-trivial copy constructor, a non-trivial move contructor, or a non-trivial destructor, with no corresponding parameter, is conditionally-supported with implementation-defined semantics. Replace SetErrorDescriptionn(errMsg); with SetErrorDescription(errMsg); Original patch by Tobias Nygren (NetBSD). Sponsored by <The NetBSD Foundation> Reviewers: clayborg, labath, emaste, joerg, ki.stfu Reviewed By: labath, ki.stfu Subscribers: tnn, ki.stfu, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29256 git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@293774 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent d2e1297 commit b889b51

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed
 

‎tools/lldb-mi/MICmnBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void CMICmnBase::ClrErrorDescription() const {
122122
// Return: None.
123123
// Throws: None.
124124
//--
125-
void CMICmnBase::SetErrorDescriptionn(const CMIUtilString vFormat, ...) const {
125+
void CMICmnBase::SetErrorDescriptionn(const char *vFormat, ...) const {
126126
va_list args;
127127
va_start(args, vFormat);
128128
CMIUtilString strResult = CMIUtilString::FormatValist(vFormat, args);

‎tools/lldb-mi/MICmnBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CMICmnBase {
2828
bool HaveErrorDescription() const;
2929
const CMIUtilString &GetErrorDescription() const;
3030
void SetErrorDescription(const CMIUtilString &vrTxt) const;
31-
void SetErrorDescriptionn(const CMIUtilString vFormat, ...) const;
31+
void SetErrorDescriptionn(const char *vFormat, ...) const;
3232
void SetErrorDescriptionNoLog(const CMIUtilString &vrTxt) const;
3333
void ClrErrorDescription() const;
3434

‎tools/lldb-mi/MIDriver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ bool CMIDriver::StartWorkerThreads() {
509509
const CMIUtilString errMsg = CMIUtilString::Format(
510510
MIRSRC(IDS_THREADMGR_ERR_THREAD_FAIL_CREATE),
511511
CMICmnThreadMgrStd::Instance().GetErrorDescription().c_str());
512-
SetErrorDescriptionn(errMsg);
512+
SetErrorDescription(errMsg);
513513
return MIstatus::failure;
514514
}
515515

‎tools/lldb-mi/MIUtilString.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ CMIUtilString CMIUtilString::FormatPriv(const CMIUtilString &vrFormat,
157157
// Return: CMIUtilString - Number of splits found in the string data.
158158
// Throws: None.
159159
//--
160-
CMIUtilString CMIUtilString::Format(const CMIUtilString vFormating, ...) {
160+
CMIUtilString CMIUtilString::Format(const char *vFormating, ...) {
161161
va_list args;
162162
va_start(args, vFormating);
163163
CMIUtilString strResult = CMIUtilString::FormatPriv(vFormating, args);

‎tools/lldb-mi/MIUtilString.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CMIUtilString : public std::string {
3030

3131
// Static method:
3232
public:
33-
static CMIUtilString Format(const CMIUtilString vFormating, ...);
33+
static CMIUtilString Format(const char *vFormating, ...);
3434
static CMIUtilString FormatBinary(const MIuint64 vnDecimal);
3535
static CMIUtilString FormatValist(const CMIUtilString &vrFormating,
3636
va_list vArgs);

0 commit comments

Comments
 (0)
This repository has been archived.