File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -84,12 +84,12 @@ not the case; consider the following example:
8484{{#include .. / ci / dma / examples / one . rs: 105 : 112 }}
8585```
8686
87- Here we start a DMA transfer, in ` foo ` , to fill an array allocated on the stack
88- and then ` mem::forget ` the returned ` Transfer ` value. Then we proceed to return
89- from ` foo ` and execute the function ` bar ` .
87+ Here we start a DMA transfer, in ` start ` , to fill an array allocated on the
88+ stack and then ` mem::forget ` the returned ` Transfer ` value. Then we proceed to
89+ return from ` start ` and execute the function ` bar ` .
9090
9191This series of operations results in undefined behavior. The DMA transfer writes
92- to stack memory but that memory is released when ` foo ` returns and then reused
92+ to stack memory but that memory is released when ` start ` returns and then reused
9393by ` bar ` to allocate variables like ` x ` and ` y ` . At runtime this could result in
9494variables ` x ` and ` y ` changing their value at random times. The DMA transfer
9595could also overwrite the state (e.g. link register) pushed onto the stack by the
You can’t perform that action at this time.
0 commit comments