Commit a53d81e
[vm] Fix out-of-bounds access to kernel library -1
Certain kinds of functions do not have corresponding kernel binary,
so Function::KernelLibraryIndex() returns -1 for them.
However, flow graph builder and scopes builder established reading of
kernel binary for those functions, which was based on a typed data
view created for a library -1 (treating some unrelated field from
kernel component index as library offset).
This change fixes this out-of-bounds access and avoids reading
any kernel for these functions.
TEST=ci
Fixes #60369
Change-Id: I91717ec6ad905b71bab49d7b3b3f636bda19afb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417102
Reviewed-by: Alexander Aprelev <[email protected]>
Commit-Queue: Alexander Markov <[email protected]>1 parent fd36ced commit a53d81e
File tree
4 files changed
+33
-13
lines changed- runtime/vm
- compiler/frontend
4 files changed
+33
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
970 | 970 | | |
971 | 971 | | |
972 | 972 | | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
977 | 980 | | |
978 | 981 | | |
979 | 982 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
126 | 134 | | |
127 | 135 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | 136 | | |
132 | 137 | | |
133 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
501 | | - | |
502 | | - | |
503 | | - | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
504 | 509 | | |
505 | 510 | | |
506 | 511 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11410 | 11410 | | |
11411 | 11411 | | |
11412 | 11412 | | |
| 11413 | + | |
| 11414 | + | |
11413 | 11415 | | |
11414 | | - | |
| 11416 | + | |
11415 | 11417 | | |
11416 | 11418 | | |
11417 | 11419 | | |
| |||
12419 | 12421 | | |
12420 | 12422 | | |
12421 | 12423 | | |
| 12424 | + | |
| 12425 | + | |
12422 | 12426 | | |
12423 | | - | |
| 12427 | + | |
12424 | 12428 | | |
12425 | 12429 | | |
12426 | 12430 | | |
| |||
15685 | 15689 | | |
15686 | 15690 | | |
15687 | 15691 | | |
| 15692 | + | |
15688 | 15693 | | |
15689 | 15694 | | |
15690 | 15695 | | |
| |||
15694 | 15699 | | |
15695 | 15700 | | |
15696 | 15701 | | |
| 15702 | + | |
15697 | 15703 | | |
15698 | 15704 | | |
15699 | 15705 | | |
| |||
15706 | 15712 | | |
15707 | 15713 | | |
15708 | 15714 | | |
| 15715 | + | |
15709 | 15716 | | |
15710 | 15717 | | |
15711 | 15718 | | |
| |||
0 commit comments