-
Notifications
You must be signed in to change notification settings - Fork 342
[BoundsSafety] Bring full support for -fbounds-safety #9665
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
[BoundsSafety] Bring full support for -fbounds-safety #9665
Conversation
@swift-ci test |
@swift-ci test llvm |
Looks like there's some problems building with gcc.
and then a whole bunch of warnings. This are all the ones that obviously looked like they were due to
|
For the macOS job we have test failures.
|
@swift-ci test |
@swift-ci llvm test |
@swift-ci test |
@swift-ci llvm test |
6585ae0
to
23c753d
Compare
23c753d
to
926ccb2
Compare
@swift-ci test |
926ccb2
to
f5e6a4b
Compare
@swift-ci test |
1 similar comment
@swift-ci test |
@swift-ci test |
Ensure APValue::DataSize is bigger than APValue::LV. To do so, this moves APValue::LV to APValue.h so that we can always allocate DataSize to be bigger than LV. Previously, LV was hidden in the source file and the type size of DataSize didn't take it into account even though it has to be bigger than LV. This made the implementation quite fragile to any change in the size of related components. rdar://137823177
@swift-ci test |
1 similar comment
@swift-ci test |
024050a
to
c41a62d
Compare
@swift-ci test |
@swift-ci test |
@swift-ci llvm test |
d9b4f7c
to
a8812a5
Compare
@swift-ci test |
@swift-ci test llvm |
-fbounds-safety
is a C extension to enforce bounds safety to prevent out-of-bounds (OOB) memory accesses. The extension offers bounds annotations that programmers can use to attach bounds to pointers. Using this bounds information, the compiler inserts bounds checks on every pointer dereference, ensuring that the program does not access memory outside the specified bounds. The compiler requires programmers to provide enough bounds information so that the accesses can be checked at either run time or compile time — and it rejects code if it cannot.For more details, please refer to
The bounds annotations provided by
-fbounds-safety
could potentially be useful to implement safe interoperation between C/C++ and safe languages such as Swift. Similar to lifetime dependency annotations as pitched here.This patch contains collaborative work from @rapidsna @apple-fcloutier @patrykstefanski @delcypher @hnrklssn and from many other collaborators from the optimization and debugger side of support.