Skip to content

Commit 8e45cf5

Browse files
[SYCL] Add assert for event impl existence in addEvent (#5257)
Minor change to ensure the existence of event implementation before dereferencing it in `queue_impl::addEvent`. Signed-off-by: Steffen Larsen <[email protected]>
1 parent 8677d5d commit 8e45cf5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sycl/source/detail/queue_impl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ event queue_impl::mem_advise(const std::shared_ptr<detail::queue_impl> &Self,
126126

127127
void queue_impl::addEvent(const event &Event) {
128128
EventImplPtr EImpl = getSyclObjImpl(Event);
129+
assert(EImpl && "Event implementation is missing");
129130
auto *Cmd = static_cast<Command *>(EImpl->getCommand());
130131
if (!Cmd) {
131132
// if there is no command on the event, we cannot track it with MEventsWeak

0 commit comments

Comments
 (0)