aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/aot
diff options
context:
space:
mode:
authorGravatar Jongmin Baek <jongmin@dropbox.com>2018-06-20 11:01:53 -0700
committerGravatar Jongmin Baek <jongmin@dropbox.com>2018-06-20 11:02:39 -0700
commit58759659ee547a957c5d36e72f2274ab34fdb6cb (patch)
treefa42be092be98570e8e806ecfea0a1007608f430 /tensorflow/compiler/aot
parent39ea5a7044a16b868e38717b358c46d6e3191373 (diff)
Fix OOB check for result_index in header generation
Diffstat (limited to 'tensorflow/compiler/aot')
-rw-r--r--tensorflow/compiler/aot/codegen.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/compiler/aot/codegen.cc b/tensorflow/compiler/aot/codegen.cc
index 0025842aea..28070d60db 100644
--- a/tensorflow/compiler/aot/codegen.cc
+++ b/tensorflow/compiler/aot/codegen.cc
@@ -287,7 +287,7 @@ Status GenerateHeader(const CodegenOpts& opts, const tf2xla::Config& config,
TF_RETURN_IF_ERROR(ValidateFeedFetchCppNames(config));
const int64 result_index = compile_result.aot->result_buffer_index();
const xla::BufferSizes& temp_sizes = compile_result.aot->buffer_sizes();
- if (result_index < 0 || result_index > temp_sizes.size()) {
+ if (result_index < 0 || result_index >= temp_sizes.size()) {
return errors::InvalidArgument("result index: ", result_index,
" is outside the range of temp sizes: [0,",
temp_sizes.size(), ")");