From 294f763d01cd534a527e9085aa98a7d2f0d672bb Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Thu, 22 Jul 2021 12:47:49 -0700 Subject: [PATCH] [NFC][MLGO] Fix vector sizing The bots only build release mode, and the use of `reserve` instead of `resize`, while not causing invalid memory accesses, is incorrect. --- lib/Analysis/ReleaseModeModelRunner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Analysis/ReleaseModeModelRunner.cpp b/lib/Analysis/ReleaseModeModelRunner.cpp index 0b038b3e1c3..d2bf9538806 100644 --- a/lib/Analysis/ReleaseModeModelRunner.cpp +++ b/lib/Analysis/ReleaseModeModelRunner.cpp @@ -52,7 +52,7 @@ ReleaseModeModelRunner::ReleaseModeModelRunner(LLVMContext &Ctx) CompiledModel(std::make_unique()) { assert(CompiledModel && "The CompiledModel should be valid"); - FeatureIndices.reserve(NumberOfFeatures); + FeatureIndices.resize(NumberOfFeatures); for (size_t I = 0; I < NumberOfFeatures; ++I) { const int Index =