Commit 1c9f4d4
authored
[ARM] Avoid reference into modified vector (#93965)
FirstCand is a reference to RepeatedSequenceLocs[0]. However, that
vector is being modified a lot throughout the function, including one
place that reassigns the whole vector. I'm not sure whether this can
really happen in practice, but it doesn't seem unlikely that this could
lead to a use-after-free.
Avoid this by directly using RepeatedSequenceLocs[0] at the start of the
function (as a lot of other places already do) and only creating
FirstCand at the end where no more modifications take place.1 parent 4023f4e commit 1c9f4d4
File tree
2 files changed
+8
-8
lines changed- llvm/lib/Target
- AArch64
- ARM
2 files changed
+8
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8257 | 8257 | | |
8258 | 8258 | | |
8259 | 8259 | | |
8260 | | - | |
8261 | | - | |
8262 | 8260 | | |
8263 | | - | |
| 8261 | + | |
8264 | 8262 | | |
8265 | 8263 | | |
8266 | 8264 | | |
| |||
8303 | 8301 | | |
8304 | 8302 | | |
8305 | 8303 | | |
8306 | | - | |
| 8304 | + | |
| 8305 | + | |
8307 | 8306 | | |
8308 | 8307 | | |
8309 | 8308 | | |
| |||
8475 | 8474 | | |
8476 | 8475 | | |
8477 | 8476 | | |
8478 | | - | |
| 8477 | + | |
| 8478 | + | |
8479 | 8479 | | |
8480 | 8480 | | |
8481 | 8481 | | |
| |||
8625 | 8625 | | |
8626 | 8626 | | |
8627 | 8627 | | |
| 8628 | + | |
8628 | 8629 | | |
8629 | 8630 | | |
8630 | 8631 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5873 | 5873 | | |
5874 | 5874 | | |
5875 | 5875 | | |
5876 | | - | |
5877 | | - | |
5878 | 5876 | | |
5879 | | - | |
| 5877 | + | |
5880 | 5878 | | |
5881 | 5879 | | |
5882 | 5880 | | |
| |||
6071 | 6069 | | |
6072 | 6070 | | |
6073 | 6071 | | |
| 6072 | + | |
6074 | 6073 | | |
6075 | 6074 | | |
6076 | 6075 | | |
| |||
0 commit comments