From 141cd4b3c22cae11401177890f0c388ab458cc30 Mon Sep 17 00:00:00 2001 From: huanghui Date: Tue, 1 Dec 2020 21:43:09 +0800 Subject: [PATCH] fix some locations miss line --- mindspore/ccsrc/pipeline/jit/parse/parse.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mindspore/ccsrc/pipeline/jit/parse/parse.cc b/mindspore/ccsrc/pipeline/jit/parse/parse.cc index b184f75771..02e3c4230a 100644 --- a/mindspore/ccsrc/pipeline/jit/parse/parse.cc +++ b/mindspore/ccsrc/pipeline/jit/parse/parse.cc @@ -752,8 +752,11 @@ AnfNodePtr Parser::ParseAttribute(const FunctionBlockPtr &block, const py::objec // process the node attr auto attr_str = python_adapter::GetPyObjAttr(node, "attr").cast(); MS_LOG(DEBUG) << "Attr = " << attr_str; - TraceGuard guard(GetLocation(python_adapter::GetPyObjAttr(node, "attr"))); - AnfNodePtr attr_node = NewValueNode(attr_str); + AnfNodePtr attr_node = nullptr; + { + TraceGuard guard(GetLocation(python_adapter::GetPyObjAttr(node, "attr"))); + attr_node = NewValueNode(attr_str); + } // create the apply node return block->func_graph()->NewCNode({op_node, value_node, attr_node});