File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1122,6 +1122,14 @@ static bool performCompile(CompilerInstance &Instance,
1122
1122
if (Action == FrontendOptions::ActionType::Typecheck) {
1123
1123
if (emitIndexData (Invocation, Instance))
1124
1124
return true ;
1125
+ // FIXME: Whole-module outputs with a non-whole-module -typecheck ought to
1126
+ // be disallowed, but the driver implements -index-file mode by generating a
1127
+ // regular whole-module frontend command line and modifying it to index just
1128
+ // one file (by making it a primary) instead of all of them. If that
1129
+ // invocation also has flags to emit whole-module supplementary outputs, the
1130
+ // compiler can crash trying to access information for non-type-checked
1131
+ // declarations in the non-primary files. For now, prevent those crashes by
1132
+ // guarding the emission of whole-module supplementary outputs.
1125
1133
if (opts.InputsAndOutputs .isWholeModule ()) {
1126
1134
if (emitAnyWholeModulePostTypeCheckSupplementaryOutputs (Instance,
1127
1135
Invocation,
You can’t perform that action at this time.
0 commit comments