aboutsummaryrefslogtreecommitdiff
path: root/utils/TableGen
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2013-03-27 18:44:56 +0000
committerDan Gohman <dan433584@gmail.com>2013-03-27 18:44:56 +0000
commitdcdc0faf59103c335bda246e3cddbc4cbd6ba83d (patch)
tree5b33c730da6b88d7798625b8aba7a3fe0270e6ba /utils/TableGen
parente77918c355610ef2c68c3b666b3a3dd0085e1766 (diff)
Avoid undefined behavior from passing a std::vector's own contents
in as an argument to push_back. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178166 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r--utils/TableGen/CodeGenSchedule.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/TableGen/CodeGenSchedule.cpp b/utils/TableGen/CodeGenSchedule.cpp
index 818fce2048..886c4c6394 100644
--- a/utils/TableGen/CodeGenSchedule.cpp
+++ b/utils/TableGen/CodeGenSchedule.cpp
@@ -1105,7 +1105,9 @@ void PredTransitions::getIntersectingVariants(
// Push another copy of the current transition for more variants.
Variant.TransVecIdx = TransVec.size();
IntersectingVariants.push_back(Variant);
- TransVec.push_back(TransVec[TransIdx]);
+
+ PredTransition Trans = TransVec[TransIdx];
+ TransVec.push_back(Trans);
}
}
}