On Mon, 22 Apr 2019 at 16:41, Kinney, Michael D <michael.d.kin...@intel.com> wrote: > > Hi Hao, > > I think a cleaner fix to this issues is replace both > ASSERT() statements with the following: > > if (EFI_ERROR (Status) || Entry->Emulator == NULL) { > FreePool (Entry); > continue; > } > > We do not expect the emulator protocol to disappear between > finding the handle and looking up the protocol instance, > but if it does, the handle can be skipped without ASSERT(). > > There are several examples of this style in DriverSupport.c. > > If we want to avoid the extra Allocate/Free in this error > condition, then a local variable can be added to get the > emulator protocol instance and only allocate an > EMULATOR_ENTRY if the emulator instance is successfully > found. >
Is there any way we can #define the OUT modifier to something the static analyzer understands? (Which static analyzer is this btw?) Surely, we are not the only project dealing with pointers that are initialized by reference. Adding code to please the tools should really be the last resort imo. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#39372): https://edk2.groups.io/g/devel/message/39372 Mute This Topic: https://groups.io/mt/31271609/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-