about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorMartinNowack <martin.nowack@gmail.com>2016-03-16 17:51:16 +0100
committerMartinNowack <martin.nowack@gmail.com>2016-03-16 17:51:16 +0100
commit007d1ee02dae61bdb0760097a700d21968514b94 (patch)
tree26c6021dffa65d538f764e6a763ad9e45e60ffee
parent7366b149824a6c899fa804674574d5b21b5171a6 (diff)
parentdb43444b45a28842a4e6693e84250c9d69863c52 (diff)
downloadklee-007d1ee02dae61bdb0760097a700d21968514b94.tar.gz
Merge pull request #358 from pollnossa/master
Wrong std::vector usage after reserve() call.
-rw-r--r--lib/Module/PhiCleaner.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Module/PhiCleaner.cpp b/lib/Module/PhiCleaner.cpp
index 3d8d7867..2cf3ba4a 100644
--- a/lib/Module/PhiCleaner.cpp
+++ b/lib/Module/PhiCleaner.cpp
@@ -39,16 +39,16 @@ bool klee::PhiCleanerPass::runOnFunction(Function &f) {
           if (pi->getIncomingBlock(i) != reference->getIncomingBlock(i))
             break;
 
-        if (i!=numBlocks) {
-          std::vector<Value*> values;
-          values.reserve(numBlocks);
-          for (unsigned i=0; i<numBlocks; i++)
-            values[i] = pi->getIncomingValueForBlock(reference->getIncomingBlock(i));
-          for (unsigned i=0; i<numBlocks; i++) {
-            pi->setIncomingBlock(i, reference->getIncomingBlock(i));
-            pi->setIncomingValue(i, values[i]);
-          }
-          changed = true;
+        if (i != numBlocks) {
+            std::vector<Value*> values;
+            values.reserve(numBlocks);
+            for (unsigned i = 0; i<numBlocks; i++)
+                values.push_back(pi->getIncomingValueForBlock(reference->getIncomingBlock(i)));
+            for (unsigned i = 0; i<numBlocks; i++) {
+                pi->setIncomingBlock(i, reference->getIncomingBlock(i));
+                pi->setIncomingValue(i, values[i]);
+            }
+            changed = true;
         }
 
         // see if it uses any previously defined phi nodes