We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 773836d commit 0514d12Copy full SHA for 0514d12
CHANGELOG.md
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
10
- Move from bors/manual merge to GH merge queue
11
- Add tools/check.py python script for local check
12
- Add changelog check on PRs
13
+- Replace UB code by a legitimate pointer access
14
15
## [v0.10.0] - 2022-12-12
16
src/spi.rs
@@ -355,7 +355,7 @@ where
355
356
fn write_data_reg(&mut self, data: FrameSize) {
357
// NOTE(write_volatile) see note above
358
- unsafe { ptr::write_volatile(&self.spi.dr as *const _ as *mut FrameSize, data) }
+ unsafe { ptr::write_volatile(ptr::addr_of!(self.spi.dr) as *mut FrameSize, data) }
359
}
360
361
// Implement write as per the "Transmit only procedure" page 712
0 commit comments