Skip to content

[SYCL][NFCI] Address static analyzer concerns #16296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sycl/include/sycl/accessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :

char padding[sizeof(detail::AccessorImplDevice<AdjustedDim>) +
sizeof(PtrType) - sizeof(detail::AccessorBaseHost) -
sizeof(MAccData)];
sizeof(MAccData)] = {0};

PtrType getQualifiedPtr() const noexcept {
if constexpr (IsHostBuf)
Expand Down Expand Up @@ -2192,7 +2192,7 @@ class __SYCL_SPECIAL_CLASS local_accessor_base :
: detail::LocalAccessorBaseHost{Impl} {}

char padding[sizeof(detail::LocalAccessorBaseDevice<AdjustedDim>) +
sizeof(PtrType) - sizeof(detail::LocalAccessorBaseHost)];
sizeof(PtrType) - sizeof(detail::LocalAccessorBaseHost)] = {0};
using detail::LocalAccessorBaseHost::getSize;

PtrType getQualifiedPtr() const {
Expand Down
4 changes: 2 additions & 2 deletions sycl/source/detail/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ void readConfig(bool ForceInitialization) {
// Finding the position of '='
Position = BufString.find("=");
// Checking that the variable name is less than MAX_CONFIG_NAME and more
// than zero character
if ((Position <= MAX_CONFIG_NAME) && (Position > 0)) {
// than zero characters.
if ((Position < MAX_CONFIG_NAME) && (Position > 0)) {
// Checking that the value is less than MAX_CONFIG_VALUE and
// more than zero character
if ((BufString.length() - (Position + 1) <= MAX_CONFIG_VALUE) &&
Expand Down
Loading