Commit 80d3756
committed
[BoundsSafety] Allow evaluating the same CLE in a bounds-check
BoundsSafety can reuse the same CompoundLiteralExpr in a bounds-check
condition. This commit changes const-eval for CompoundLiteralExpr to
reset the state and evaluate it again when the temporary for that
CompoundLiteralExpr already exists.
In addition, we skip const-eval in Sema when building a bounds-check
condition. That const-eval is used only for diagnostics and we don't
want to diagnose AST that we are generating.
This is merely a workaround. The proper solution is to not emit the AST
for bounds-check condition and defer it to CodeGen.
rdar://1570332411 parent c67fa5d commit 80d3756
File tree
5 files changed
+80
-15
lines changed- clang
- include/clang/Sema
- lib
- AST
- Sema
- test/BoundsSafety/CodeGen
5 files changed
+80
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7934 | 7934 | | |
7935 | 7935 | | |
7936 | 7936 | | |
7937 | | - | |
| 7937 | + | |
| 7938 | + | |
7938 | 7939 | | |
7939 | 7940 | | |
7940 | 7941 | | |
| |||
8642 | 8643 | | |
8643 | 8644 | | |
8644 | 8645 | | |
8645 | | - | |
| 8646 | + | |
8646 | 8647 | | |
8647 | 8648 | | |
8648 | 8649 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9448 | 9448 | | |
9449 | 9449 | | |
9450 | 9450 | | |
| 9451 | + | |
| 9452 | + | |
| 9453 | + | |
| 9454 | + | |
| 9455 | + | |
| 9456 | + | |
| 9457 | + | |
| 9458 | + | |
| 9459 | + | |
| 9460 | + | |
| 9461 | + | |
| 9462 | + | |
| 9463 | + | |
| 9464 | + | |
9451 | 9465 | | |
9452 | 9466 | | |
9453 | 9467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14430 | 14430 | | |
14431 | 14431 | | |
14432 | 14432 | | |
| 14433 | + | |
| 14434 | + | |
| 14435 | + | |
| 14436 | + | |
| 14437 | + | |
| 14438 | + | |
| 14439 | + | |
| 14440 | + | |
14433 | 14441 | | |
14434 | 14442 | | |
14435 | 14443 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16503 | 16503 | | |
16504 | 16504 | | |
16505 | 16505 | | |
16506 | | - | |
| 16506 | + | |
| 16507 | + | |
16507 | 16508 | | |
16508 | 16509 | | |
16509 | 16510 | | |
| |||
16534 | 16535 | | |
16535 | 16536 | | |
16536 | 16537 | | |
16537 | | - | |
| 16538 | + | |
| 16539 | + | |
16538 | 16540 | | |
16539 | 16541 | | |
16540 | 16542 | | |
| |||
18250 | 18252 | | |
18251 | 18253 | | |
18252 | 18254 | | |
18253 | | - | |
| 18255 | + | |
| 18256 | + | |
18254 | 18257 | | |
18255 | 18258 | | |
18256 | 18259 | | |
| |||
18404 | 18407 | | |
18405 | 18408 | | |
18406 | 18409 | | |
18407 | | - | |
| 18410 | + | |
| 18411 | + | |
18408 | 18412 | | |
18409 | 18413 | | |
18410 | 18414 | | |
| |||
26188 | 26192 | | |
26189 | 26193 | | |
26190 | 26194 | | |
26191 | | - | |
| 26195 | + | |
| 26196 | + | |
| 26197 | + | |
26192 | 26198 | | |
26193 | 26199 | | |
26194 | 26200 | | |
| |||
26207 | 26213 | | |
26208 | 26214 | | |
26209 | 26215 | | |
26210 | | - | |
| 26216 | + | |
| 26217 | + | |
| 26218 | + | |
26211 | 26219 | | |
26212 | 26220 | | |
26213 | 26221 | | |
| |||
26230 | 26238 | | |
26231 | 26239 | | |
26232 | 26240 | | |
26233 | | - | |
| 26241 | + | |
| 26242 | + | |
26234 | 26243 | | |
26235 | 26244 | | |
26236 | 26245 | | |
| |||
26415 | 26424 | | |
26416 | 26425 | | |
26417 | 26426 | | |
26418 | | - | |
| 26427 | + | |
| 26428 | + | |
| 26429 | + | |
26419 | 26430 | | |
26420 | 26431 | | |
26421 | 26432 | | |
| |||
26430 | 26441 | | |
26431 | 26442 | | |
26432 | 26443 | | |
26433 | | - | |
26434 | | - | |
| 26444 | + | |
| 26445 | + | |
| 26446 | + | |
| 26447 | + | |
26435 | 26448 | | |
26436 | 26449 | | |
26437 | 26450 | | |
| |||
26471 | 26484 | | |
26472 | 26485 | | |
26473 | 26486 | | |
26474 | | - | |
| 26487 | + | |
| 26488 | + | |
| 26489 | + | |
26475 | 26490 | | |
26476 | 26491 | | |
26477 | 26492 | | |
26478 | 26493 | | |
26479 | 26494 | | |
26480 | 26495 | | |
26481 | | - | |
26482 | | - | |
| 26496 | + | |
| 26497 | + | |
| 26498 | + | |
26483 | 26499 | | |
26484 | 26500 | | |
26485 | 26501 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
0 commit comments