forked from OSchip/llvm-project
Correct the usage of DataInfo structure in TSan
llvm-svn: 221297
This commit is contained in:
parent
f5b34e535d
commit
0b622f1d64
|
@ -61,13 +61,23 @@ struct AddressInfo {
|
|||
}
|
||||
};
|
||||
|
||||
// For now, DataInfo is used to describe global variable.
|
||||
struct DataInfo {
|
||||
uptr address;
|
||||
char *module;
|
||||
uptr module_offset;
|
||||
char *name;
|
||||
uptr start;
|
||||
uptr size;
|
||||
|
||||
DataInfo() {
|
||||
internal_memset(this, 0, sizeof(DataInfo));
|
||||
}
|
||||
|
||||
void Clear() {
|
||||
InternalFree(module);
|
||||
InternalFree(name);
|
||||
internal_memset(this, 0, sizeof(DataInfo));
|
||||
}
|
||||
};
|
||||
|
||||
class Symbolizer {
|
||||
|
|
|
@ -589,8 +589,7 @@ class POSIXSymbolizer : public Symbolizer {
|
|||
return false;
|
||||
const char *module_name = module->full_name();
|
||||
uptr module_offset = addr - module->base_address();
|
||||
internal_memset(info, 0, sizeof(*info));
|
||||
info->address = addr;
|
||||
info->Clear();
|
||||
info->module = internal_strdup(module_name);
|
||||
info->module_offset = module_offset;
|
||||
// First, try to use libbacktrace symbolizer (if it's available).
|
||||
|
|
|
@ -110,6 +110,7 @@ ReportLocation *SymbolizeData(uptr addr) {
|
|||
ent->name = internal_strdup(info.name);
|
||||
ent->addr = info.start;
|
||||
ent->size = info.size;
|
||||
info.Clear();
|
||||
return ent;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue