On 11/24/20 12:05, xiewenyi (A) wrote:
Hi Laszlo,Well, we can approach this on two levels.
The first level is whether the code transformation (the patch) that you
are describing above would be correct. Yes, removing the comparison in
question is correct. Please feel free to post the patch.
But the deeper (zeroth) level is more nuanced. Namely, it's not
specifically the *non-nullity* of "Info" that guarantees
(Info->VolumeLabel != NULL). Instead, that consequence originates from
the *validity* of Info (namely, that it points to an
EFI_FILE_SYSTEM_VOLUME_LABEL object), and from the fact that
"VolumeLabel" is an *array* in EFI_FILE_SYSTEM_VOLUME_LABEL. The address
of an array object (well, of any object) that *exists* can never be NULL.
I'm not sure if my depiction is understandable. Basically, if Info is
not NULL, then (Info->VolumeLabel != NULL) holds *exactly because*:
ASSERT (&VolumeLabel != NULL);
holds as well.
Anyway... feel free to post the patch.
On 2020/11/24 18:52, Laszlo Ersek wrote:On 11/24/20 10:22, wenyi,xie via groups.io wrote:Hi all，Assuming Info is a valid pointer, Info->VolumeLabel is an array object.