dotnet/runtime

Сhecking for NULL

Open

#92 566 ouverte le 24 sept. 2023

Voir sur GitHub
 (2 commentaires) (1 réaction) (0 assignés)C# (5 445 forks)batch import
area-TypeSystem-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

Description

We have two pointer pMT dereferences: https://github.com/dotnet/runtime/blob/cc2670b53ecc1576d3aa1a1011476c99372adfd7/src/coreclr/vm/typedesc.cpp#L888 https://github.com/dotnet/runtime/blob/cc2670b53ecc1576d3aa1a1011476c99372adfd7/src/coreclr/vm/typedesc.cpp#L909 And they are absolutely identical. But before the second dereference there is a check for NULL, before the first there is not. I assume two options. The first option is an unnecessary check. The second option is that the pointer at the first dereference can really be NULL. Between these two dereferences, the pointer pMT itself does not change. Only the following lines: https://github.com/dotnet/runtime/blob/cc2670b53ecc1576d3aa1a1011476c99372adfd7/src/coreclr/vm/typedesc.cpp#L890-L898 Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.

Author A. Voronin.

Guide contributeur