From 0f36d31e146891b24dc5dde06dd128f232b7e284 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Wed, 4 Apr 2012 18:56:25 -0700 Subject: [PATCH] Bug 736898: Avoid signed/unsigned comparisons in tools/profiler, r=bgirard --HG-- extra : rebase_source : 53eadd48e29fc1aae143b0480bcb573a392e1130 --- tools/profiler/TableTicker.cpp | 2 +- tools/profiler/sps_sampler.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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];