Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix a NPE issue in invalid Exit op. Now it will report an error inste…
…ad of crash.

PiperOrigin-RevId: 404089902
Change-Id: Ia6ec55445ea70ad045a4d339d354959ad0618f2a
  • Loading branch information
qqfish authored and tensorflower-gardener committed Oct 18, 2021
1 parent 3586950 commit 05cbebd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tensorflow/core/common_runtime/immutable_executor_state.cc
Expand Up @@ -316,6 +316,10 @@ Status ImmutableExecutorState::BuildControlFlowInfo(const Graph* g,
} else if (IsExit(curr_node)) {
// Exit to the parent frame.
parent = parent_nodes[curr_id];
if (!parent) {
return errors::InvalidArgument(
"Invalid Exit op: Cannot find a corresponding Enter op.");
}
frame_name = cf_info->frame_names[parent->id()];
parent = parent_nodes[parent->id()];
} else {
Expand Down

0 comments on commit 05cbebd

Please sign in to comment.