You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reset comparersInUse to zero in ContextState.reset (#18915)
Fixes#18855
The code in #18855 used to crash the compiler with an out-of-bound
access exception. It was because, previously, `ContextState.reset`
clears the `comparers`, the cached pool of `TypeComparer`s, while
keeping the variable `comparersInUse` intact. However, the `comparer`
method of a context assumes `comparers` has a size greater than or equal
to `comparersInUse`. So the invariant is clearly violated here and thus
triggers the crash.
This PR proposes a straightforward fix. Yet, the reason why only under
both macros and cc this code path will be triggered remains to be
investigated.
0 commit comments