Skip to content

Conversation

@steffenlarsen
Copy link
Contributor

This commit makes the following changes to sate Coverity:

  1. Initializes uninitialized variables. This mainly affects UR handles that are expected to be set after their corresponding UR calls.
  2. Catch exceptions in dtors, similar to how we do for *_impl classes.
  3. Fix use-after-move cases and set more appropriate ownerships.
  4. Change a selection of arguments to const references.

Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
KData.getNDRDesc(), std::move(HostKernelPtr),
nullptr, // Kernel
nullptr, // KernelBundle
std::move(CGData), std::move(KData).getArgs(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove the std::move(KData).getArgs()?

Copy link
Contributor Author

@steffenlarsen steffenlarsen Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KData is used in the following arguments. That's a use-after-move.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but we do not move the KData itself here. Such syntax forces calling of the right overload of getArgs() that does the move of args. With your change it will be a copy instead of move.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I was not aware of that syntax... And I suppose neither is Coverity. 😆

I still have concerns regarding it, but I can revert it here and we can discuss it in #20617 (comment).

Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
@steffenlarsen
Copy link
Contributor Author

@vinser52 - Have all your concerns been addressed?

@steffenlarsen steffenlarsen merged commit 72c54ee into intel:sycl Nov 21, 2025
56 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants