aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/BUILD
diff options
context:
space:
mode:
authorGravatar Piotr Padlewski <prazek@google.com>2018-08-09 12:48:32 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-09 12:52:04 -0700
commitc216a1be9564bd6b83b1e81b1eea65cc381bd82e (patch)
treee389e6170b9cda78621511b9c6e49b43e93ec20c /tensorflow/compiler/xla/service/BUILD
parent689fecc0712944da54230eb0aa7bc733e918afd1 (diff)
Fix emplace_back(new) calls
Doing v.emplace_back(new Type) on a std::vector<std::unique_ptr<Type>> is not exception safe. This is because it cause a leak of passed pointer if emplace_back would throw exception before emplacement (e.g. not enough memory to add a new element). PiperOrigin-RevId: 208095516
Diffstat (limited to 'tensorflow/compiler/xla/service/BUILD')
-rw-r--r--tensorflow/compiler/xla/service/BUILD1
1 files changed, 1 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/service/BUILD b/tensorflow/compiler/xla/service/BUILD
index 1b93d72a3e..3480ec4038 100644
--- a/tensorflow/compiler/xla/service/BUILD
+++ b/tensorflow/compiler/xla/service/BUILD
@@ -613,6 +613,7 @@ cc_library(
"//tensorflow/compiler/xla:xla_proto",
"//tensorflow/compiler/xla/legacy_flags:debug_options_flags",
"//tensorflow/core:lib",
+ "//tensorflow/core:ptr_util",
"//tensorflow/core:stream_executor_no_cuda",
],
alwayslink = 1,