Skip to content

Commit 0f2af55

Browse files
committed
address static analyzer false-positives
Change-Id: I88aaf614bca6083f8e8b22677ba4367dfb047933
1 parent 9687b5d commit 0f2af55

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/cpucounters.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2930,6 +2930,10 @@ PCM::ErrorCode PCM::programCoreCounters(const int i /* core */,
29302930
auto handleIt = perfEventTaskHandle.begin();
29312931
for (const auto & tid: tids)
29322932
{
2933+
if (handleIt == perfEventTaskHandle.end())
2934+
{
2935+
break;
2936+
}
29332937
if (programPerfEventHelper(*handleIt, e, eventPos, eventName, -1, tid) == false)
29342938
{
29352939
return false;
@@ -7807,7 +7811,10 @@ void PCM::programUBOX(const uint64* events)
78077811

78087812
*uboxPMUs[s].fixedCounterControl = UCLK_FIXED_CTL_EN;
78097813

7810-
PCM::program(uboxPMUs[s], events, events + 2, 0);
7814+
if (events)
7815+
{
7816+
PCM::program(uboxPMUs[s], events, events + 2, 0);
7817+
}
78117818
}
78127819
}
78137820

src/pcm.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,11 @@ int main(int argc, char * argv[])
11791179
{
11801180
argv++;
11811181
argc--;
1182+
if (*argv == nullptr)
1183+
{
1184+
continue;
1185+
}
1186+
else
11821187
if (strncmp(*argv, "--help", 6) == 0 ||
11831188
strncmp(*argv, "-h", 2) == 0 ||
11841189
strncmp(*argv, "/h", 2) == 0)

0 commit comments

Comments
 (0)