mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-18 13:55:23 +01:00
Fixed UB in spawn_at
This commit is contained in:
parent
2068eae928
commit
51500a1d70
4 changed files with 11 additions and 17 deletions
|
|
@ -22,6 +22,4 @@ proc-macro2 = "1"
|
|||
proc-macro-error = "1"
|
||||
quote = "1"
|
||||
syn = "1"
|
||||
# rtic-syntax = "0.5.0-alpha.2"
|
||||
rtic-syntax = { path = "../../rtic-syntax", version = "0.5.0-alpha.2" }
|
||||
|
||||
rtic-syntax = "0.5.0-alpha.2"
|
||||
|
|
|
|||
|
|
@ -414,17 +414,11 @@ pub fn codegen(
|
|||
|
||||
let tq = unsafe { &mut *#app_path::#tq.as_mut_ptr() };
|
||||
|
||||
if let Some(mono) = #app_path::#m_ident.as_mut() {
|
||||
tq.enqueue_unchecked(
|
||||
nr,
|
||||
|| #enable_interrupt,
|
||||
|| #pend,
|
||||
mono)
|
||||
} else {
|
||||
// We can only use the timer queue if `init` has returned, and it
|
||||
// writes the `Some(monotonic)` we are accessing here.
|
||||
core::hint::unreachable_unchecked()
|
||||
}
|
||||
tq.enqueue_unchecked(
|
||||
nr,
|
||||
|| #enable_interrupt,
|
||||
|| #pend,
|
||||
#app_path::#m_ident.as_mut());
|
||||
|
||||
Ok(SpawnHandle { marker })
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue