-
Notifications
You must be signed in to change notification settings - Fork 794
[SYCL][NFC] Avoid nullptr dereferencing of YDimExpr and ZDimExpr #4367
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
Conversation
Fix the Klocworks exposed bug for non sycl:: or intel:: usage by refactoring and adding checks to avoid nullptr dereferencing
Fix whitespace
premanandrao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Fixing commit message now. |
AaronBallman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Can you also add "NFC" to the review title as this has no functional change?
|
Thank you for the review, @erichkeane @AaronBallman - I updated the description and title. Thanks @premanandrao |
|
Working on reproducing the test failures locally. |
Still unable to reproduce the failure locally. Machine ran out of space meanwhile. Will try a diferent macine. |
Do it after checking for 3 argument requirement for OpenCL and cl:: spellings
11f0a79
Assert in SetDefaultValue that it is not possible for sycl:: or intel:: cases to have NULL arguments Move error checking of three arguments for OpenCL and cl:: cases ahead of the assert in SetDefaultValue
AaronBallman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM aside from a microscopic commenting nit, thanks!
|
Removed extra |
smanna12
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch.
AaronBallman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thank you for all the reviews! |
|
@schittir, can you add a test for these changes? |
I don't think there is a real case where the assert is false. This is a non-functional change made to appease Klocwork. |
MrSidims
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Post-factum LGTM
…el#4367) Add assert that arguments of work_group_size attributes cannot be nullptr Klocwork exposed a (false positive) bug that nullptr derferencing of YDimExpr and ZDimExpr is possible for non sycl:: usage. This is not practically possible because such (OpenCL and cl::) spellings of the attribute require three arguments. This patch 1. Removes the ability of SetDefaultValue lambda to return nullptr 2. Asserts in SetDefaultValue that it is not possible for sycl:: case to have NULL arguments 3. Moves error checking for three arguments for OpenCL and cl:: cases ahead of the assert 4. Removes check for intel::reqd_work_group_size spelling
Add assert that arguments of work_group_size attributes cannot be nullptr
Klocwork exposed a (false positive) bug that nullptr derferencing of
YDimExpr and ZDimExpr is possible for non sycl:: usage.
This is not practically possible because such (OpenCL and cl::) spellings
of the attribute require three arguments.
This patch
to have NULL arguments
ahead of the assert