diff --git a/src/cpucounters.cpp b/src/cpucounters.cpp index ce3aa211..861f1f4f 100644 --- a/src/cpucounters.cpp +++ b/src/cpucounters.cpp @@ -1466,6 +1466,7 @@ bool PCM::discoverSystemTopology() MSR.push_back(std::make_shared(i)); } + assert(num_cores > 0); TopologyEntry entries[num_cores]; if (MSR[0]->buildTopology(num_cores, entries) != 0) { std::cerr << "Unable to build CPU topology" << std::endl;