Skip to content

Commit 2b1c82f

Browse files
committed
[IDE] Make sure to clear cached CI when CachedCIShouldBeInvalidated
`performNewOperation` may not set a new compiler instance if e.g it ends up being cancelled, so we need to make sure we reset the cached compiler instance to ensure future requests don't attempt to re-use it. Noticed by inspection.
1 parent 36b5090 commit 2b1c82f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/IDETool/IDEInspectionInstance.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,10 @@ bool IDEInspectionInstance::performCachedOperationIfPossible(
213213

214214
// Check the invalidation first. Otherwise, in case no 'CacheCI' exists yet,
215215
// the flag will remain 'true' even after 'CachedCI' is populated.
216-
if (CachedCIShouldBeInvalidated.exchange(false))
216+
if (CachedCIShouldBeInvalidated.exchange(false)) {
217+
CachedCI = nullptr;
217218
return false;
219+
}
218220
if (!CachedCI)
219221
return false;
220222
if (CachedReuseCount >= Opts.MaxASTReuseCount)

0 commit comments

Comments
 (0)