-
Notifications
You must be signed in to change notification settings - Fork 791
Description
See CID 535530. Coverity issues can be accessed via https://scan.coverity.com/projects/intel-llvm?tab=overview
llvm/sycl/source/detail/kernel_bundle_impl.hpp
Lines 985 to 988 in 25d2e78
| return std::make_shared<kernel_impl>( | |
| std::move(Kernel), *detail::getSyclObjImpl(MContext), | |
| std::move(SelectedImage), *this, ArgMask, | |
| SelectedImage->get_ur_program(), CacheMutex); |
The problem here is that evaluation order of function arguments is undefined (pre C++17)/unspecified (post C++17), from cppreference:
Order of evaluation of any part of any expression, including order of evaluation of function arguments is unspecified (with some exceptions listed below). The compiler can evaluate operands and other subexpressions in any order, and may choose another order when the same expression is evaluated again.
14) In a function call, value computations and side effects of the initialization of every parameter are indeterminately sequenced with respect to value computations and side effects of any other parameter. (since C++17)
That means that std::move(SelectedImage) may be evaluated before SelectedImage->get_ur_program() resulting in access to a moved object