dotnet/runtime
Voir sur GitHubNull checks in incorrect order in Cordb::Terminate
Open
#47 463 ouverte le 26 janv. 2021
area-Diagnostics-coreclrhelp wanted
Métriques du dépôt
- Stars
- (17 886 stars)
- Métriques de merge PR
- (Merge moyen 12j 11h) (661 PRs mergées en 30 j)
Description
There's a null-check for m_rcEventThread in Cordb::Terminate here:
But the variable is already used without null-testing a littler earlier in the same method:
If the variable was actually null, dereferencing it leads to undefined behaviour, so a compiler is free to assume that wont happen. A recent compiler might therefore remove the null check on line 1125 entirely. We should probably null-check m_rcEventThread everywhere, or remove the null-checks.