From bfc4714531978867a7f68a52f0b614b63f06a391 Mon Sep 17 00:00:00 2001 From: vpushkar Date: Wed, 16 Mar 2016 15:54:26 +0300 Subject: Wrong std::vector 'values' usage after vector's capacity reserve. It is the error to use [] operator for accessing vector's elements after reserving. In such cases push_back/emplace methods should be used. But in this source code the usage of std::vector is redundant. So vector 'values' was iliminated. --- lib/Module/PhiCleaner.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/Module/PhiCleaner.cpp b/lib/Module/PhiCleaner.cpp index 3d8d7867..eff3d495 100644 --- a/lib/Module/PhiCleaner.cpp +++ b/lib/Module/PhiCleaner.cpp @@ -40,13 +40,9 @@ bool klee::PhiCleanerPass::runOnFunction(Function &f) { break; if (i!=numBlocks) { - std::vector values; - values.reserve(numBlocks); - for (unsigned i=0; igetIncomingValueForBlock(reference->getIncomingBlock(i)); for (unsigned i=0; isetIncomingBlock(i, reference->getIncomingBlock(i)); - pi->setIncomingValue(i, values[i]); + pi->setIncomingValue(i, pi->getIncomingValueForBlock(reference->getIncomingBlock(i))); } changed = true; } -- cgit 1.4.1