diff --git a/tools/profiler/TableTicker.cpp b/tools/profiler/TableTicker.cpp index 841ff140db7..378dd5bef09 100644 --- a/tools/profiler/TableTicker.cpp +++ b/tools/profiler/TableTicker.cpp @@ -580,7 +580,7 @@ void doSampleStackTrace(ProfileStack *aStack, ThreadProfile &aProfile, TickSampl // Sample // 's' tag denotes the start of a sample block // followed by 0 or more 'c' tags. - for (int i = 0; i < aStack->mStackPointer; i++) { + for (mozilla::sig_safe_t i = 0; i < aStack->mStackPointer; i++) { if (i == 0) { Address pc = 0; if (sample) { diff --git a/tools/profiler/sps_sampler.h b/tools/profiler/sps_sampler.h index 94c68ed3b01..5972a4cddcc 100644 --- a/tools/profiler/sps_sampler.h +++ b/tools/profiler/sps_sampler.h @@ -212,7 +212,8 @@ public: if (mQueueClearMarker) { clearMarkers(); } - if (aMarkerId >= mMarkerPointer) { + if (aMarkerId < 0 || + static_cast(aMarkerId) >= mMarkerPointer) { return NULL; } return mMarkers[aMarkerId];