diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-07-09 01:18:47 +0200 |
|---|---|---|
| committer | diondokter <[email protected]> | 2025-08-29 13:22:59 +0200 |
| commit | 34ff67cdbf25e278ff99bd4a05b6b8c6a30fa5d1 (patch) | |
| tree | ba211d244ddd820f9f3e9e7c7f9eb32033fb6221 | |
| parent | da9cdf0c536ec4fa7bdfb649750c44f70ef1cd55 (diff) | |
executor: do not deref a mut ptr to the entire taskheader.
| -rw-r--r-- | embassy-executor/src/raw/trace.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/embassy-executor/src/raw/trace.rs b/embassy-executor/src/raw/trace.rs index ab0c1b8b6..e52960dc7 100644 --- a/embassy-executor/src/raw/trace.rs +++ b/embassy-executor/src/raw/trace.rs | |||
| @@ -128,7 +128,7 @@ impl TaskTracker { | |||
| 128 | /// # Arguments | 128 | /// # Arguments |
| 129 | /// * `task` - The task reference to add to the tracker | 129 | /// * `task` - The task reference to add to the tracker |
| 130 | pub fn add(&self, task: TaskRef) { | 130 | pub fn add(&self, task: TaskRef) { |
| 131 | let task_ptr = task.as_ptr() as *mut TaskHeader; | 131 | let task_ptr = task.as_ptr(); |
| 132 | 132 | ||
| 133 | loop { | 133 | loop { |
| 134 | let current_head = self.head.load(Ordering::Acquire); | 134 | let current_head = self.head.load(Ordering::Acquire); |
| @@ -138,7 +138,7 @@ impl TaskTracker { | |||
| 138 | 138 | ||
| 139 | if self | 139 | if self |
| 140 | .head | 140 | .head |
| 141 | .compare_exchange(current_head, task_ptr, Ordering::Release, Ordering::Relaxed) | 141 | .compare_exchange(current_head, task_ptr.cast_mut(), Ordering::Release, Ordering::Relaxed) |
| 142 | .is_ok() | 142 | .is_ok() |
| 143 | { | 143 | { |
| 144 | break; | 144 | break; |
