if (!DataFirst) {
DataFirst = Data;
DataLast = Data + 1;
- CountersFirst = Data->CounterPtr;
- CountersLast = (uint64_t *)Data->CounterPtr + Data->NumCounters;
+ CountersFirst = (uint64_t *)((uintptr_t)Data_ + Data->CounterPtr);
+ CountersLast = CountersFirst + Data->NumCounters;
return;
}
DataFirst = (const __llvm_profile_data *)getMinAddr(DataFirst, Data);
- CountersFirst = (uint64_t *)getMinAddr(CountersFirst, Data->CounterPtr);
+ CountersFirst = (uint64_t *)getMinAddr(
+ CountersFirst, (uint64_t *)((uintptr_t)Data_ + Data->CounterPtr));
DataLast = (const __llvm_profile_data *)getMaxAddr(DataLast, Data + 1);
CountersLast = (uint64_t *)getMaxAddr(
- CountersLast, (uint64_t *)Data->CounterPtr + Data->NumCounters);
+ CountersLast,
+ (uint64_t *)((uintptr_t)Data_ + Data->CounterPtr) + Data->NumCounters);
}
COMPILER_RT_VISIBILITY