Skip to content

Addressed "Very high" Coverity issue: dereferencing null pointer #1369

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

Conversation

oleksandr-pavlyk
Copy link
Contributor

@oleksandr-pavlyk oleksandr-pavlyk commented Aug 25, 2023

Ensured that create_property_list always returns an not-null unique pointer by creating an default-constructed property_list for the fall-through.

With this change we no longer need two branches for call to sycl::queue constructor, since propList is always available.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you opening the PR as a draft?

Ensured that `create_property_list` always returns an not-null unique
pointer by creating an default-constructed property_list for the
fall-through.

With this change we no longer need to branches for call to sycl::queue
constructor, since propList is always available.
@github-actions
Copy link

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 85.645% (+0.009%) from 85.636% when pulling 60d1f26 on fix-coverity-issue-in-dpctl-sycl-queue-interface into 8eab04b on master.

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.6dev4=py310ha25a700_15 ran successfully.
Passed: 916
Failed: 84
Skipped: 119

@oleksandr-pavlyk oleksandr-pavlyk changed the title Addressed Very high Coverity issue Addressed "Very high" Coverity issue Aug 25, 2023
ndgrigorian
ndgrigorian previously approved these changes Aug 26, 2023
@oleksandr-pavlyk oleksandr-pavlyk changed the title Addressed "Very high" Coverity issue Addressed "Very high" Coverity issue: dereferencing null pointer Aug 27, 2023
@@ -143,6 +143,9 @@ std::unique_ptr<property_list> create_property_list(int properties)
propList =
std::make_unique<property_list>(sycl::property::queue::in_order());
}
else {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was not aware SYCL runtime allows an empty property_list. The change is good.

Remove unneeded static keyword in definition of create_property_list function in anonymous namespace
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.6dev4=py310ha25a700_29 ran successfully.
Passed: 916
Failed: 84
Skipped: 119

@oleksandr-pavlyk oleksandr-pavlyk merged commit 718c51e into master Aug 28, 2023
@oleksandr-pavlyk oleksandr-pavlyk deleted the fix-coverity-issue-in-dpctl-sycl-queue-interface branch August 28, 2023 19:04
@github-actions
Copy link

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.6dev4=py310ha25a700_29 ran successfully.
Passed: 916
Failed: 84
Skipped: 119

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.

4 participants