Commit 02aeff2
authored
Disallow some implicit void pointer conversions in checked scopes (#590)
In memory-safe checked scopes, disallow implicit conversions to and from void pointer types when the non-void pointer type points to data that contains a checked pointer. Disallow these conversions at assignments, call arguments, return statements, and arms of conditional expressions. Memory-safe checked scopes are currently the default kind of checked scopes. This addresses part of Github issue #571.
Also do some cleanup within the compiler. Rename the checked scope specifier for the default checked scope from "BoundsAndTypes" to "Memory". The original name is incorrect for the kind of safety that will be provided.
Testing:
- Add new tests to the Checked C repo for these cases.
- Passed automated testing on Windows and Linux.1 parent c77f7ef commit 02aeff2
File tree
14 files changed
+80
-24
lines changed- include/clang
- Basic
- Sema
- lib
- AST
- Parse
- Sema
14 files changed
+80
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9412 | 9412 | | |
9413 | 9413 | | |
9414 | 9414 | | |
| 9415 | + | |
| 9416 | + | |
| 9417 | + | |
| 9418 | + | |
| 9419 | + | |
| 9420 | + | |
| 9421 | + | |
| 9422 | + | |
9415 | 9423 | | |
9416 | 9424 | | |
9417 | 9425 | | |
| |||
9465 | 9473 | | |
9466 | 9474 | | |
9467 | 9475 | | |
9468 | | - | |
9469 | 9476 | | |
9470 | 9477 | | |
9471 | 9478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
| 338 | + | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
| 338 | + | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9901 | 9901 | | |
9902 | 9902 | | |
9903 | 9903 | | |
| 9904 | + | |
| 9905 | + | |
| 9906 | + | |
| 9907 | + | |
| 9908 | + | |
9904 | 9909 | | |
9905 | 9910 | | |
9906 | 9911 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1204 | 1204 | | |
1205 | 1205 | | |
1206 | 1206 | | |
1207 | | - | |
| 1207 | + | |
1208 | 1208 | | |
1209 | 1209 | | |
1210 | 1210 | | |
| |||
2056 | 2056 | | |
2057 | 2057 | | |
2058 | 2058 | | |
2059 | | - | |
| 2059 | + | |
2060 | 2060 | | |
2061 | 2061 | | |
2062 | 2062 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
506 | | - | |
| 506 | + | |
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3080 | 3080 | | |
3081 | 3081 | | |
3082 | 3082 | | |
3083 | | - | |
| 3083 | + | |
3084 | 3084 | | |
3085 | 3085 | | |
3086 | 3086 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1625 | 1625 | | |
1626 | 1626 | | |
1627 | 1627 | | |
1628 | | - | |
| 1628 | + | |
1629 | 1629 | | |
1630 | 1630 | | |
1631 | 1631 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
897 | | - | |
| 897 | + | |
898 | 898 | | |
899 | 899 | | |
900 | 900 | | |
| |||
0 commit comments