Commit 2d93e2a
committed
[clang][cas] Fix crash on invalid with IncludeTreeBuilder
If an error occurs in FrontendAction::BeginSourceFile after
IncludeTreeActionController::initializeModuleBuild is called (via
BeginInvocation), the builder is left in an inconsistent state because
there is no call to finalizeModuleBuild (via HandleTranslationUnit), so
we should exit early without attempting to create an include tree for
the broken module. Fixes a crash on invalid seen with a missing module
header, but there could be other similar cases.
rdar://151878898
(cherry picked from commit 5d380b9)1 parent bd45852 commit 2d93e2a
File tree
2 files changed
+35
-0
lines changed- clang
- lib/Tooling/DependencyScanning
- test/ClangScanDeps
2 files changed
+35
-0
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
389 | 396 | | |
390 | 397 | | |
391 | 398 | | |
| |||
Lines changed: 28 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 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments