embassy-rs / nrf-softdevice

Apache License 2.0
256 stars 76 forks source link

portal: fix UB. #176

Closed Dirbaio closed 1 year ago

Dirbaio commented 1 year ago

The fn was passed by value to set_function_pointer, and set_function_pointer was storing a ptr to its arg in state. When set_function_pointer returns, the arg is gone. Pass it by pointer instead, so it lives as long as the wait/wait_many futures.

Maybe fixes #175