Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Fix uninitialized fields Coverity hits (#15237)
This PR fixes Coverity hits regarding uninitialized class fields in the runtime. I'd like to bring attention to `sycl_mem_obj_t.hpp` however: There, I have initialized `MSizeInBytes` of the `SYCLMemObjT` class to 0: This should not cause any problems (at least not more), as currently all subclasses of `SYCLMemObjT` that actually use the `MSizeInBytes` have it defined (`buffer_impl`, `image_impl`) when their respective constructors are called. However, this does mean programmers must remember to initialize `MSizeInBytes` when using `image_impl`. To avoid this, I could rewrite some of the constructors in e.g. `image_impl` and `SYCLMemObjT`, but I'd like to not overcomplicate the problem here. So I was hoping for some other opinions: Is initializing as 0 sufficient, or should I go ahead and make the changes to the constructors anyway to be safe? Thanks in advance!
- Loading branch information