diff options
author | 2018-08-09 12:48:32 -0700 | |
---|---|---|
committer | 2018-08-09 12:52:04 -0700 | |
commit | c216a1be9564bd6b83b1e81b1eea65cc381bd82e (patch) | |
tree | e389e6170b9cda78621511b9c6e49b43e93ec20c /tensorflow/compiler/xla/service/BUILD | |
parent | 689fecc0712944da54230eb0aa7bc733e918afd1 (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/BUILD | 1 |
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, |