Skip to content

Commit c02f915

Browse files
julianmiBensuo
andauthored
Fix Coverity dereference before null check issue (#13456)
Fixes an issue found by Coverity in `addEventForNode` about dereferencing the `EventImpl` before a null check. --------- Co-authored-by: Ben Tracy <[email protected]>
1 parent a073a6a commit c02f915

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sycl/source/detail/graph_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ class graph_impl {
899899
void addEventForNode(std::shared_ptr<graph_impl> GraphImpl,
900900
std::shared_ptr<sycl::detail::event_impl> EventImpl,
901901
std::shared_ptr<node_impl> NodeImpl) {
902-
if (!(EventImpl->getCommandGraph()))
902+
if (EventImpl && !(EventImpl->getCommandGraph()))
903903
EventImpl->setCommandGraph(GraphImpl);
904904
MEventsMap[EventImpl] = NodeImpl;
905905
}

0 commit comments

Comments
 (0)