[asan] Replace assignments with internal_memcpy ErrorDescription
For consistency with nearby code and to avoid interceptors during reports. llvm-svn: 361304
This commit is contained in:
parent
a7e88f8570
commit
e756730c23
|
|
@ -404,8 +404,10 @@ struct ErrorGeneric : ErrorBase {
|
|||
|
||||
#define ASAN_DEFINE_ERROR_KIND(name) kErrorKind##name,
|
||||
#define ASAN_ERROR_DESCRIPTION_MEMBER(name) Error##name name;
|
||||
#define ASAN_ERROR_DESCRIPTION_CONSTRUCTOR(name) \
|
||||
ErrorDescription(Error##name const &e) : kind(kErrorKind##name), name(e) {}
|
||||
#define ASAN_ERROR_DESCRIPTION_CONSTRUCTOR(name) \
|
||||
ErrorDescription(Error##name const &e) : kind(kErrorKind##name) { \
|
||||
internal_memcpy(&name, &e, sizeof(name)); \
|
||||
}
|
||||
#define ASAN_ERROR_DESCRIPTION_PRINT(name) \
|
||||
case kErrorKind##name: \
|
||||
return name.Print();
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ class ScopedInErrorReport {
|
|||
void ReportError(const ErrorDescription &description) {
|
||||
// Can only report one error per ScopedInErrorReport.
|
||||
CHECK_EQ(current_error_.kind, kErrorKindInvalid);
|
||||
current_error_ = description;
|
||||
internal_memcpy(¤t_error_, &description, sizeof(current_error_));
|
||||
}
|
||||
|
||||
static ErrorDescription &CurrentError() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue