Skip to content

Fix UnsafeBufferPointer validation test. #5021

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 27, 2016
Merged

Fix UnsafeBufferPointer validation test. #5021

merged 1 commit into from
Sep 27, 2016

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Sep 26, 2016

There are several checks related to accessing a slice of an
UnsafeBufferPointer. Which tests are active depend on the level of
optimization. A raw buffer's checks are also stricter in some cases.

This test was originally designed to either crash or not for each input range
without regard to the nuances of when bounds checks are enabled. When an input
range was marked as crashing, that forced the test case to crash which was
self-fullfilling--nothing was really being tested in that case.

In my previous checkin, I enabled crash checking to be effective but missed some
of the nuances of different bounds checking modes. This commit adds logic to the test
to account for these nuances.

There are several checks related to accessing a slice of an
UnsafeBufferPointer. Which tests are active depend on the level of
optimization. A raw buffer's checks are also stricter in some cases.

This test was originally designed to either crash or not for each input range
without regard to the nuances of when bounds checks are enabled. When an input
range was marked as crashing, that forced the test case to crash which was
self-fullfilling--nothing was really being tested in that case.

In my previous checkin, I enabled crash checking to be effective but missed some
of the nuances of different bounds checking modes. This commit adds logic to the test
to account for these nuances.
@atrick
Copy link
Contributor Author

atrick commented Sep 26, 2016

@swift-ci test and merge.

@atrick
Copy link
Contributor Author

atrick commented Sep 26, 2016

@swift-ci smoke test linux.

@atrick atrick merged commit 894be37 into swiftlang:master Sep 27, 2016
@atrick atrick deleted the unsafebytes branch May 26, 2017 02:05
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.

1 participant