зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1428612 - Part 2: Add an assertion to check the histogram name pointer. r=gfritzsche
This adds a dignostic assertion that the name pointer is actually within the static name table. --HG-- extra : rebase_source : 4f82f72c83444a3ccd5be270080837f60110766e
This commit is contained in:
Родитель
67e0ab19b7
Коммит
ba599d7f41
|
@ -1741,6 +1741,11 @@ void TelemetryHistogram::InitializeGlobalState(bool canRecordBase,
|
|||
for (uint32_t i = 0; i < HistogramCount; i++) {
|
||||
auto name = gHistogramInfos[i].name();
|
||||
|
||||
// Make sure the name pointer is in a valid region. See bug 1428612.
|
||||
MOZ_DIAGNOSTIC_ASSERT(name >= gHistogramStringTable);
|
||||
MOZ_DIAGNOSTIC_ASSERT(
|
||||
uintptr_t(name) < (uintptr_t(gHistogramStringTable) + sizeof(gHistogramStringTable)));
|
||||
|
||||
nsCString wrappedName;
|
||||
wrappedName.AssignLiteral(name, strlen(name));
|
||||
gNameToHistogramIDMap.Put(wrappedName, HistogramID(i));
|
||||
|
|
Загрузка…
Ссылка в новой задаче