From f87bce659d65d7a4a140ffc6e7ec5fcb2ce16997 Mon Sep 17 00:00:00 2001 From: Steffen Larsen Date: Tue, 4 Jan 2022 15:56:21 +0300 Subject: [PATCH] [SYCL] Add assert for event impl existence in addEvent Minor change to ensure the existence of event implementation before dereferencing it in `queue_impl::addEvent`. Signed-off-by: Steffen Larsen --- sycl/source/detail/queue_impl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sycl/source/detail/queue_impl.cpp b/sycl/source/detail/queue_impl.cpp index d5427ffc52020..d484e10b5e5f5 100644 --- a/sycl/source/detail/queue_impl.cpp +++ b/sycl/source/detail/queue_impl.cpp @@ -126,6 +126,7 @@ event queue_impl::mem_advise(const std::shared_ptr &Self, void queue_impl::addEvent(const event &Event) { EventImplPtr EImpl = getSyclObjImpl(Event); + assert(EImpl && "Event implementation is missing"); auto *Cmd = static_cast(EImpl->getCommand()); if (!Cmd) { // if there is no command on the event, we cannot track it with MEventsWeak