Skip to content

Commit de22d1a

Browse files
Fix asan error with uninitialized variable in shape_refiner.cc.
Change: 133753457
1 parent 92f2cb7 commit de22d1a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tensorflow/core/common_runtime/shape_refiner.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Status ShapeRefiner::AddNode(const Node* node) {
110110
const Edge* input_edge;
111111
TF_RETURN_IF_ERROR(node->input_edge(i, &input_edge));
112112

113-
bool is_constant_graph;
113+
bool is_constant_graph = false;
114114
Graph subgraph(ops_registry_);
115115

116116
// We identify the possibly constant subgraph to evaluate by
@@ -200,6 +200,7 @@ Status ShapeRefiner::SetShape(const Node* node, int output_port,
200200
Status ShapeRefiner::ExtractConstantSubgraph(
201201
Node* target_node, Graph* out_graph, bool* is_constant_graph,
202202
std::vector<std::pair<string, Tensor>>* const_inputs) {
203+
*is_constant_graph = false;
203204
std::unordered_set<string> const_inputs_added;
204205

205206
if (target_node->op_def().is_stateful()) {

0 commit comments

Comments
 (0)