提交 97e4f0d3 编写于 作者: A A. Unique TensorFlower 提交者: TensorFlower Gardener

LSC: Allow targets to pass with `-fsanitize=null` under `--config=asan`.

This is a manually-generated change. Ensure that behavior and style are
preserved by carefully inspecting the diff.

This CL fixes one of the many targets in TAP that test with ASan but fail
with `-fsanitize=null`. We would like to enable the Null Pointer Sanitizer
in builds that use Address Sanitizer globally, and this change gets us one
step closer to that goal.

PiperOrigin-RevId: 306704264
Change-Id: I15fc65a7e3c7b3ed81e5b72038b070c6b847ff3f
上级 dffe4770
......@@ -1505,9 +1505,17 @@ const FunctionDef* FunctionLibraryDefinition::GetAttrImpl(
// function's attrs to see if noinline is specified. Otherwise,
// uses func's attrs.
if (!grad_name.empty()) {
return &(FindHelper(grad_name)->fdef);
if (const auto helper = FindHelper(grad_name)) {
return &(helper->fdef);
} else {
return nullptr;
}
}
if (const auto helper = FindHelper(func_name)) {
return &(helper->fdef);
} else {
return nullptr;
}
return &(FindHelper(func_name)->fdef);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册