Skip to content

Commit c800fbb

Browse files
[SYCL] Coverity scan fixes for #17380 (#18133)
Changes in #17380 introduced some Coverity detected issues. This commit fixes the following issues: 1. Removes noexcept from get_bin_image_ref as it can now potentially throw through std::variant interfaces. 2. Adheres to rule-of-three in ManagedDeviceGlobalsRegistry and ManagedDeviceBinaries. Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 46da71a commit c800fbb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sycl/source/detail/device_image_impl.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ class ManagedDeviceGlobalsRegistry {
6666

6767
ManagedDeviceGlobalsRegistry(const ManagedDeviceGlobalsRegistry &) = delete;
6868

69+
ManagedDeviceGlobalsRegistry &
70+
operator=(const ManagedDeviceGlobalsRegistry &) = delete;
71+
6972
~ManagedDeviceGlobalsRegistry() {
7073
try {
7174
unregisterDeviceGlobalsFromContext();
@@ -128,6 +131,8 @@ class ManagedDeviceBinaries {
128131

129132
ManagedDeviceBinaries(const ManagedDeviceBinaries &) = delete;
130133

134+
ManagedDeviceBinaries &operator=(const ManagedDeviceBinaries &) = delete;
135+
131136
~ManagedDeviceBinaries() {
132137
try {
133138
ProgramManager::getInstance().removeImages(MBinaries);
@@ -518,7 +523,7 @@ class device_image_impl {
518523
return MProgram;
519524
}
520525

521-
const RTDeviceBinaryImage *const &get_bin_image_ref() const noexcept {
526+
const RTDeviceBinaryImage *const &get_bin_image_ref() const {
522527
return std::get<const RTDeviceBinaryImage *>(MBinImage);
523528
}
524529

0 commit comments

Comments
 (0)