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:
84
84
{{#include .. / ci / dma / examples / one . rs: 105 : 112 }}
85
85
```
86
86
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 ` .
90
90
91
91
This 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
93
93
by ` bar ` to allocate variables like ` x ` and ` y ` . At runtime this could result in
94
94
variables ` x ` and ` y ` changing their value at random times. The DMA transfer
95
95
could 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