Open GrantM11235 opened 3 months ago
rcc::frequency() is a public function, and there is nothing preventing a user from calling it before init(). Internally it calls unsafe { rcc::get_freqs() } which is UB if rcc::set_freqs() hasn't been called yet.
rcc::frequency()
init()
unsafe { rcc::get_freqs() }
rcc::set_freqs()
rcc::frequency()
is a public function, and there is nothing preventing a user from calling it beforeinit()
. Internally it callsunsafe { rcc::get_freqs() }
which is UB ifrcc::set_freqs()
hasn't been called yet.