Skip to content

[SYCL] Fix UB in memory manager #2310

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
merged 2 commits into from
Aug 13, 2020
Merged

Conversation

alexbatashev
Copy link
Contributor

If vector is empty, accessing any of its elements is UB. Use data()
method to get pointer to vector data.

Signed-off-by: Alexander Batashev alexander.batashev@intel.com

If vector is empty, accessing any of its elements is UB. Use `data()`
method to get pointer to vector data.

Signed-off-by: Alexander Batashev <alexander.batashev@intel.com>
@alexbatashev alexbatashev requested a review from a team as a code owner August 13, 2020 08:09
@keryell
Copy link
Contributor

keryell commented Aug 13, 2020

Is a bug fix [NFC]?
Before we have UB, such as launch a nuclear missile.
After the fix we no longer launch a missile. Definitely not an [NFC] for me.

@bader bader changed the title [SYCL][NFC] Fix UB in memory manager [SYCL] Fix UB in memory manager Aug 13, 2020
@bader bader merged commit 4ff2eee into intel:sycl Aug 13, 2020
alexbatashev pushed a commit to alexbatashev/llvm that referenced this pull request Aug 17, 2020
alexbatashev pushed a commit to alexbatashev/llvm that referenced this pull request Aug 17, 2020
alexbatashev pushed a commit to alexbatashev/llvm that referenced this pull request Aug 17, 2020
alexbatashev pushed a commit to alexbatashev/llvm that referenced this pull request Aug 17, 2020
bader pushed a commit that referenced this pull request Aug 19, 2020
This is a followup for #2310. The patch adds an option to enable assertions in standard containers and algorithms (such as bounds and null pointer checks) both in SYCL runtime and tests. These checks are also enabled in post-commit to catch possible regressions.
@alexbatashev alexbatashev deleted the fix_mem_manager_ub branch October 31, 2020 09:43
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