Skip to content

[SYCL] Use a copy to avoid invalidated access #2495

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 1 commit into from
Sep 21, 2020

Conversation

premanandrao
Copy link
Contributor

This fixes a bug introduced in PR #2430 where the iterator
might get invalidated between accesses.

Signed-off-by: Premanand M Rao [email protected]

This fixes a bug introduced in PR intel#2430 where the iterator
might get invalidated between accesses.

Signed-off-by: Premanand M Rao <[email protected]>
@elizabethandrews
Copy link
Contributor

Change looks ok but can you explain what was wrong with the old code? I don't get why that doesn't work

@premanandrao
Copy link
Contributor Author

Change looks ok but can you explain what was wrong with the old code? I don't get why that doesn't work

In between the first access of DDI->second and subsequent accesses the container that DDI points to changes. This shows up with the Windows library implementation (but not the Linux implementation). As a result when subsequently accessed, it results in an access violation.

@romanovvlad romanovvlad merged commit 6832d83 into intel:sycl Sep 21, 2020
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.

3 participants