Commit 71ad307
authored
[Clang] prevent crash on unterminated __has_embed (#163107)
Fixes #162953
---
This PR addresses the issue of Clang crashing on unterminated
`__has_embed` by guarding all `DiscardUntilEndOfDirective` paths with
the contextual end token and diagnosing the missing `)` before reporting
_unknown_ parameters.1 parent 0ded75c commit 71ad307
File tree
4 files changed
+41
-10
lines changed- clang
- docs
- lib/Lex
- test/Preprocessor
4 files changed
+41
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
| 416 | + | |
416 | 417 | | |
417 | 418 | | |
418 | 419 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3665 | 3665 | | |
3666 | 3666 | | |
3667 | 3667 | | |
3668 | | - | |
| 3668 | + | |
3669 | 3669 | | |
3670 | 3670 | | |
3671 | 3671 | | |
3672 | 3672 | | |
3673 | 3673 | | |
3674 | 3674 | | |
3675 | | - | |
| 3675 | + | |
3676 | 3676 | | |
3677 | 3677 | | |
3678 | 3678 | | |
| |||
3763 | 3763 | | |
3764 | 3764 | | |
3765 | 3765 | | |
3766 | | - | |
| 3766 | + | |
3767 | 3767 | | |
3768 | 3768 | | |
3769 | 3769 | | |
| |||
3906 | 3906 | | |
3907 | 3907 | | |
3908 | 3908 | | |
3909 | | - | |
| 3909 | + | |
3910 | 3910 | | |
3911 | 3911 | | |
3912 | 3912 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1262 | 1262 | | |
1263 | 1263 | | |
1264 | 1264 | | |
1265 | | - | |
1266 | | - | |
1267 | 1265 | | |
1268 | 1266 | | |
1269 | 1267 | | |
1270 | 1268 | | |
1271 | | - | |
1272 | | - | |
1273 | | - | |
1274 | | - | |
| 1269 | + | |
1275 | 1270 | | |
1276 | 1271 | | |
1277 | 1272 | | |
| |||
1280 | 1275 | | |
1281 | 1276 | | |
1282 | 1277 | | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
1283 | 1281 | | |
1284 | 1282 | | |
1285 | 1283 | | |
| |||
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
0 commit comments