mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-09 01:29:52 +00:00
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 llvm-svn: 293774
This commit is contained in:
parent
25f6d710d9
commit
b5bc933c29
@ -122,7 +122,7 @@ void CMICmnBase::ClrErrorDescription() const {
|
||||
// Return: None.
|
||||
// Throws: None.
|
||||
//--
|
||||
void CMICmnBase::SetErrorDescriptionn(const CMIUtilString vFormat, ...) const {
|
||||
void CMICmnBase::SetErrorDescriptionn(const char *vFormat, ...) const {
|
||||
va_list args;
|
||||
va_start(args, vFormat);
|
||||
CMIUtilString strResult = CMIUtilString::FormatValist(vFormat, args);
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
bool HaveErrorDescription() const;
|
||||
const CMIUtilString &GetErrorDescription() const;
|
||||
void SetErrorDescription(const CMIUtilString &vrTxt) const;
|
||||
void SetErrorDescriptionn(const CMIUtilString vFormat, ...) const;
|
||||
void SetErrorDescriptionn(const char *vFormat, ...) const;
|
||||
void SetErrorDescriptionNoLog(const CMIUtilString &vrTxt) const;
|
||||
void ClrErrorDescription() const;
|
||||
|
||||
|
@ -509,7 +509,7 @@ bool CMIDriver::StartWorkerThreads() {
|
||||
const CMIUtilString errMsg = CMIUtilString::Format(
|
||||
MIRSRC(IDS_THREADMGR_ERR_THREAD_FAIL_CREATE),
|
||||
CMICmnThreadMgrStd::Instance().GetErrorDescription().c_str());
|
||||
SetErrorDescriptionn(errMsg);
|
||||
SetErrorDescription(errMsg);
|
||||
return MIstatus::failure;
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ CMIUtilString CMIUtilString::FormatPriv(const CMIUtilString &vrFormat,
|
||||
// Return: CMIUtilString - Number of splits found in the string data.
|
||||
// Throws: None.
|
||||
//--
|
||||
CMIUtilString CMIUtilString::Format(const CMIUtilString vFormating, ...) {
|
||||
CMIUtilString CMIUtilString::Format(const char *vFormating, ...) {
|
||||
va_list args;
|
||||
va_start(args, vFormating);
|
||||
CMIUtilString strResult = CMIUtilString::FormatPriv(vFormating, args);
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
|
||||
// Static method:
|
||||
public:
|
||||
static CMIUtilString Format(const CMIUtilString vFormating, ...);
|
||||
static CMIUtilString Format(const char *vFormating, ...);
|
||||
static CMIUtilString FormatBinary(const MIuint64 vnDecimal);
|
||||
static CMIUtilString FormatValist(const CMIUtilString &vrFormating,
|
||||
va_list vArgs);
|
||||
|
Loading…
Reference in New Issue
Block a user