From 71f68914fa2e7c0b661fcf11a09362b7f9564eb9 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Fri, 9 May 2008 07:52:58 +0000 Subject: Fix the prediction warnings in DxeMain. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5190 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Dxe/Image/Image.c | 8 ++++---- MdeModulePkg/Core/Dxe/Image/ImageFile.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'MdeModulePkg/Core/Dxe/Image') diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index 7c66f07d76..0770399cd9 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -332,7 +332,7 @@ CoreLoadPeImage ( // is used to relocate the image when SetVirtualAddressMap() is called. The // relocation is done by the Runtime AP. // - if (Attribute & EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION) { + if ((Attribute & EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION) != 0) { if (Image->ImageContext.ImageType == EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER) { Image->ImageContext.FixupData = CoreAllocateRuntimePool ((UINTN)(Image->ImageContext.FixupDataSize)); if (Image->ImageContext.FixupData == NULL) { @@ -432,7 +432,7 @@ CoreLoadPeImage ( Image->Info.ImageSize = Image->ImageContext.ImageSize; Image->Info.ImageCodeType = (EFI_MEMORY_TYPE) (Image->ImageContext.ImageCodeMemoryType); Image->Info.ImageDataType = (EFI_MEMORY_TYPE) (Image->ImageContext.ImageDataMemoryType); - if (Attribute & EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION) { + if ((Attribute & EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION) != 0) { if (Image->ImageContext.ImageType == EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER) { // // Make a list off all the RT images so we can let the RT AP know about them. @@ -754,7 +754,7 @@ CoreLoadImageCommon ( // // Register the image in the Debug Image Info Table if the attribute is set // - if (Attribute & EFI_LOAD_PE_IMAGE_ATTRIBUTE_DEBUG_IMAGE_INFO_TABLE_REGISTRATION) { + if ((Attribute & EFI_LOAD_PE_IMAGE_ATTRIBUTE_DEBUG_IMAGE_INFO_TABLE_REGISTRATION) != 0) { CoreNewDebugImageInfoEntry (EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL, &Image->Info, Image->Handle); } @@ -1014,7 +1014,7 @@ CoreStartImage ( // The initial call to SetJump() must always return 0. // Subsequent calls to LongJump() cause a non-zero value to be returned by SetJump(). // - if (!SetJumpFlag) { + if (SetJumpFlag == 0) { // // Call the image's entry point // diff --git a/MdeModulePkg/Core/Dxe/Image/ImageFile.c b/MdeModulePkg/Core/Dxe/Image/ImageFile.c index 7cb2576c4f..d3f28e2a26 100644 --- a/MdeModulePkg/Core/Dxe/Image/ImageFile.c +++ b/MdeModulePkg/Core/Dxe/Image/ImageFile.c @@ -467,7 +467,7 @@ CoreGrowBuffer ( // // If there's an error, free the buffer // - if ((!TryAgain) && (EFI_ERROR (*Status)) && (*Buffer)) { + if ((!TryAgain) && (EFI_ERROR (*Status)) && (*Buffer != NULL)) { CoreFreePool (*Buffer); *Buffer = NULL; } -- cgit v1.2.3