dotnet/runtime

Сhecking for NULL

Open

#92.566 geöffnet am 24. Sept. 2023

Auf GitHub ansehen
 (2 Kommentare) (1 Reaktion) (0 zugewiesene Personen)C# (5.445 Forks)batch import
area-TypeSystem-coreclrhelp wanted

Repository-Metriken

Stars
 (17.886 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 12T 11h) (661 gemergte PRs in 30 T)

Beschreibung

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.

Contributor Guide