Correct the usage of DataInfo structure in TSan

llvm-svn: 221297
This commit is contained in:
Alexey Samsonov 2014-11-04 21:26:56 +00:00
parent f5b34e535d
commit 0b622f1d64
3 changed files with 13 additions and 3 deletions

View File

@ -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 {

View File

@ -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).

View File

@ -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;
}