some fighting with idiotic ASSERTs

Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
Sergey Isakov 2019-09-15 21:27:19 +03:00
parent 3345280983
commit 14a7206c5b
18 changed files with 184 additions and 45 deletions

View File

@ -2008,12 +2008,10 @@ DEFINE GCC_X64_RC_FLAGS = -I binary -O elf64-x86-64 -B i386 --re
DEFINE GCC_ARM_RC_FLAGS = -I binary -O elf32-littlearm -B arm --rename-section .data=.hii
DEFINE GCC_AARCH64_RC_FLAGS = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii
DEFINE GCC48_ALL_CC_FLAGS = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -Wno-unused-const-variable -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
DEFINE GCC48_ALL_CC_FLAGS = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
DEFINE GCC48_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20
DEFINE GCC48_IA32_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -Wno-address
DEFINE GCC48_X64_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m64 -fno-stack-protector -mabi=ms "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address -Os -flto
DEFINE GCC48_IA32_X64_ASLDLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable
DEFINE GCC48_IA32_X64_DLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive
DEFINE GCC48_IA32_DLINK2_FLAGS = -Wl,--defsym=PECOFF_HEADER_SIZE=0x220 DEF(GCC_DLINK2_FLAGS_COMMON)
@ -2081,7 +2079,7 @@ DEFINE GCC5_AARCH64_ASLDLINK_FLAGS = DEF(GCC49_AARCH64_ASLDLINK_FLAGS)
DEFINE GCC5_ASLCC_FLAGS = DEF(GCC49_ASLCC_FLAGS) -fno-lto
DEFINE GCC53_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS)
DEFINE GCC53_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS)
DEFINE GCC53_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Wno-unused-but-set-variable
DEFINE GCC53_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections,-z,common-page-size=0x40,--defsym=PECOFF_HEADER_SIZE=0x280,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
DEFINE GCC53_IA32_X64_ASLDLINK_FLAGS = DEF(GCC53_IA32_X64_DLINK_COMMON),--entry,ReferenceAcpiTable,-u,ReferenceAcpiTable

View File

@ -2079,7 +2079,7 @@ DEFINE GCC5_AARCH64_ASLDLINK_FLAGS = DEF(GCC49_AARCH64_ASLDLINK_FLAGS)
DEFINE GCC5_ASLCC_FLAGS = DEF(GCC49_ASLCC_FLAGS) -fno-lto
DEFINE GCC53_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS)
DEFINE GCC53_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS)
DEFINE GCC53_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Wno-unused-but-set-variable
DEFINE GCC53_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections,-z,common-page-size=0x40,--defsym=PECOFF_HEADER_SIZE=0x280,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
DEFINE GCC53_IA32_X64_ASLDLINK_FLAGS = DEF(GCC53_IA32_X64_DLINK_COMMON),--entry,ReferenceAcpiTable,-u,ReferenceAcpiTable

View File

@ -181,11 +181,13 @@ FreePages (
IN UINTN Pages
)
{
EFI_STATUS Status;
// EFI_STATUS Status;
ASSERT (Pages != 0);
Status = CoreFreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages);
ASSERT_EFI_ERROR (Status);
if (Pages != 0) {
/* Status = */CoreFreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages);
}
// ASSERT_EFI_ERROR (Status);
}
/**
@ -421,11 +423,13 @@ FreeAlignedPages (
IN UINTN Pages
)
{
EFI_STATUS Status;
// EFI_STATUS Status;
ASSERT (Pages != 0);
Status = CoreFreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages);
ASSERT_EFI_ERROR (Status);
if (Pages != 0) {
/* Status = */ CoreFreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages);
}
// ASSERT_EFI_ERROR (Status);
}
/**
@ -1046,9 +1050,9 @@ FreePool (
IN VOID *Buffer
)
{
EFI_STATUS Status;
// EFI_STATUS Status;
Status = CoreFreePool (Buffer);
ASSERT_EFI_ERROR (Status);
/* Status = */ CoreFreePool (Buffer);
// ASSERT_EFI_ERROR (Status);
}

View File

@ -146,11 +146,17 @@ RegisterSecurityHandler (
EFI_STATUS Status;
ASSERT (SecurityHandler != NULL);
if (!SecurityHandler) {
return EFI_INVALID_PARAMETER;
}
//
// Make sure AuthenticationOperation is valid in the register order.
//
ASSERT (CheckAuthenticationOperation (mCurrentAuthOperation, AuthenticationOperation));
if (!CheckAuthenticationOperation (mCurrentAuthOperation, AuthenticationOperation)) {
return EFI_INVALID_PARAMETER;
}
mCurrentAuthOperation = mCurrentAuthOperation | AuthenticationOperation;
//
@ -162,6 +168,9 @@ RegisterSecurityHandler (
//
Status = ReallocateSecurityHandlerTable();
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status)) {
return Status;
}
}
//
@ -399,11 +408,17 @@ RegisterSecurity2Handler (
EFI_STATUS Status;
ASSERT (Security2Handler != NULL);
if (!Security2Handler) {
return EFI_INVALID_PARAMETER;
}
//
// Make sure AuthenticationOperation is valid in the register order.
//
ASSERT (CheckAuthentication2Operation (mCurrentAuthOperation2, AuthenticationOperation));
if (!CheckAuthentication2Operation (mCurrentAuthOperation2, AuthenticationOperation)) {
return EFI_INVALID_PARAMETER;
}
mCurrentAuthOperation2 = mCurrentAuthOperation2 | AuthenticationOperation;
//
@ -415,6 +430,9 @@ RegisterSecurity2Handler (
//
Status = ReallocateSecurity2HandlerTable();
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status)) {
return Status;
}
}
//

View File

@ -1286,6 +1286,9 @@ BmGetRamDiskMemoryInfo (
UINT64 EndingAddr;
ASSERT (RamDiskDevicePath != NULL);
if (!RamDiskDevicePath) {
return NULL;
}
*RamDiskSizeInPages = 0;
@ -1294,6 +1297,9 @@ BmGetRamDiskMemoryInfo (
//
Status = gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &RamDiskDevicePath, &Handle);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status)) {
return NULL;
}
ASSERT ((DevicePathType (RamDiskDevicePath) == MEDIA_DEVICE_PATH) &&
(DevicePathSubType (RamDiskDevicePath) == MEDIA_RAM_DISK_DP));
StartingAddr = ReadUnaligned64 ((UINT64 *) ((MEDIA_RAM_DISK_DEVICE_PATH *) RamDiskDevicePath)->StartingAddr);
@ -1321,6 +1327,10 @@ BmDestroyRamDisk (
UINTN RamDiskSizeInPages;
ASSERT (RamDiskDevicePath != NULL);
if (!RamDiskDevicePath) {
return;
}
RamDiskBuffer = BmGetRamDiskMemoryInfo (RamDiskDevicePath, &RamDiskSizeInPages);
@ -1330,9 +1340,12 @@ BmDestroyRamDisk (
if (mRamDisk == NULL) {
Status = gBS->LocateProtocol (&gEfiRamDiskProtocolGuid, NULL, (VOID *) &mRamDisk);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status)) {
return;
}
Status = mRamDisk->Unregister (RamDiskDevicePath);
ASSERT_EFI_ERROR (Status);
}
/* Status = */mRamDisk->Unregister (RamDiskDevicePath);
// ASSERT_EFI_ERROR (Status);
FreePages (RamDiskBuffer, RamDiskSizeInPages);
}
@ -1366,6 +1379,10 @@ BmExpandLoadFile (
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status)) {
return NULL;
}
FileBuffer = NULL;
BufferSize = 0;
@ -1534,6 +1551,9 @@ BmGetNextLoadOptionDevicePath (
EFI_STATUS Status;
ASSERT (FilePath != NULL);
if (!FilePath) {
return NULL;
}
//
// Boot from media device by adding a default file name \EFI\BOOT\BOOT{machine type short-name}.EFI
@ -2292,6 +2312,7 @@ EfiBootManagerRefreshAllBootOption (
// Deleting variable with current variable implementation shouldn't fail.
//
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status)) break;
}
}
}
@ -2404,6 +2425,9 @@ BmRegisterBootManagerMenu (
(VOID **) &LoadedImage
);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
return Status;
}
DevicePath = AppendDevicePathNode (
DevicePathFromHandle (LoadedImage->DeviceHandle),
(EFI_DEVICE_PATH_PROTOCOL *) &FileNode
@ -2422,11 +2446,16 @@ BmRegisterBootManagerMenu (
0
);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
return Status;
}
if (DevicePath) {
FreePool (DevicePath);
}
if (Description != NULL) {
FreePool (Description);
}
/*
DEBUG_CODE (
EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions;
UINTN BootOptionCount;
@ -2435,7 +2464,7 @@ BmRegisterBootManagerMenu (
ASSERT (EfiBootManagerFindLoadOption (BootOption, BootOptions, BootOptionCount) == -1);
EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
);
*/
return EfiBootManagerAddLoadOptionVariable (BootOption, 0);
}
@ -2457,7 +2486,7 @@ EfiBootManagerGetBootManagerMenu (
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption
)
{
EFI_STATUS Status;
// EFI_STATUS Status;
UINTN BootOptionCount;
EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions;
UINTN Index;
@ -2466,7 +2495,7 @@ EfiBootManagerGetBootManagerMenu (
for (Index = 0; Index < BootOptionCount; Index++) {
if (BmIsBootManagerMenuFilePath (BootOptions[Index].FilePath)) {
Status = EfiBootManagerInitializeLoadOption (
/*Status = */EfiBootManagerInitializeLoadOption (
BootOption,
BootOptions[Index].OptionNumber,
BootOptions[Index].OptionType,
@ -2476,7 +2505,8 @@ EfiBootManagerGetBootManagerMenu (
BootOptions[Index].OptionalData,
BootOptions[Index].OptionalDataSize
);
ASSERT_EFI_ERROR (Status);
// ASSERT_EFI_ERROR (Status);
break;
}
}

View File

@ -683,6 +683,7 @@ BmProcessKeyOption (
for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) {
Status = gBS->HandleProtocol (Handles[HandleIndex], &gEfiSimpleTextInputExProtocolGuid, (VOID **) &TxtInEx);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status)) continue;
BmRegisterHotkeyNotify (TxtInEx, Hotkey);
}
}

View File

@ -152,6 +152,9 @@ HiiAddPackages (
UINT8 *Data;
ASSERT (PackageListGuid != NULL);
if (!PackageListGuid) {
return NULL;
}
//
// Calculate the length of all the packages in the variable argument list
@ -251,11 +254,14 @@ HiiRemovePackages (
IN EFI_HII_HANDLE HiiHandle
)
{
EFI_STATUS Status;
// EFI_STATUS Status;
ASSERT (HiiHandle != NULL);
Status = gHiiDatabase->RemovePackageList (gHiiDatabase, HiiHandle);
ASSERT_EFI_ERROR (Status);
if (!HiiHandle) {
return;
}
/* Status = */gHiiDatabase->RemovePackageList (gHiiDatabase, HiiHandle);
// ASSERT_EFI_ERROR (Status);
}

View File

@ -230,6 +230,16 @@ DevicePathCompare (
(VOID**)&mUnicodeCollation);
ASSERT_EFI_ERROR(Status);
if (EFI_ERROR(Status)) {
return -1;
}
/* if (EFI_ERROR(Status)) {
Status = gBS->LocateProtocol(
&gEfiUnicodeCollationProtocolGuid,
NULL,
(VOID**)&mUnicodeCollation);
} */
}
TextPath1 = ConvertDevicePathToText(
@ -247,10 +257,14 @@ DevicePathCompare (
} else if (TextPath2 == NULL) {
RetVal = 1;
} else {
if (mUnicodeCollation) {
RetVal = mUnicodeCollation->StriColl(
mUnicodeCollation,
TextPath1,
TextPath2);
} else {
RetVal = 1;
}
}
USL_FREE_NON_NULL(TextPath1);
@ -284,6 +298,9 @@ StringNoCaseCompare (
(VOID**)&mUnicodeCollation);
ASSERT_EFI_ERROR(Status);
if (EFI_ERROR(Status)) {
return -1;
}
}
return (mUnicodeCollation->StriColl(

View File

@ -43,13 +43,16 @@ StrCpy (
)
{
CHAR16 *ReturnValue;
INTN DestMax;
// INTN DestMax;
//
// Destination cannot be NULL
//
ASSERT (Destination != NULL);
ASSERT (((UINTN) Destination & BIT0) == 0);
if (!Destination || !Source) {
return NULL;
}
//
// Destination and source cannot overlap
@ -57,7 +60,7 @@ StrCpy (
ASSERT ((UINTN)(Destination - Source) > StrLen (Source));
ASSERT ((UINTN)(Source - Destination) > StrLen (Source));
DestMax = StrLen (Destination);
// DestMax = StrLen (Destination);
ReturnValue = Destination;
while (*Source != 0) {

View File

@ -154,7 +154,8 @@ AcquireSpinLock (
Delta += Cycle;
}
Total += Delta;
ASSERT (Total < Timeout);
// ASSERT (Total < Timeout);
if (Total >= Timeout) break;
}
}
return SpinLock;
@ -187,9 +188,15 @@ AcquireSpinLockOrFail (
VOID *Result;
ASSERT (SpinLock != NULL);
if (!SpinLock) {
return FALSE;
}
LockValue = *SpinLock;
ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);
if (!(LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED)) {
return FALSE;
}
_ReadWriteBarrier ();
Result = InterlockedCompareExchangePointer (
@ -225,9 +232,15 @@ ReleaseSpinLock (
SPIN_LOCK LockValue;
ASSERT (SpinLock != NULL);
if (!SpinLock) {
return NULL;
}
LockValue = *SpinLock;
ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);
if (!(LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED)) {
return NULL;
}
_ReadWriteBarrier ();
*SpinLock = SPIN_LOCK_RELEASED;

View File

@ -46,6 +46,9 @@ GetHobList (
if (mHobList == NULL) {
Status = EfiGetSystemConfigurationTable (&gEfiHobListGuid, &mHobList);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status)) {
return NULL;
}
ASSERT (mHobList != NULL);
}
return mHobList;

View File

@ -45,6 +45,9 @@ GetPiPcdProtocol (
//
Status = gBS->LocateProtocol (&gEfiPcdProtocolGuid, NULL, (VOID **) &mPiPcd);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status)) {
return NULL;
}
ASSERT (mPiPcd != NULL);
}
return mPiPcd;
@ -70,6 +73,9 @@ GetPcdProtocol (
//
Status = gBS->LocateProtocol (&gPcdProtocolGuid, NULL, (VOID **)&mPcd);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status)) {
return NULL;
}
ASSERT (mPcd != NULL);
}
return mPcd;
@ -90,6 +96,9 @@ GetPiPcdInfoProtocolPointer (
if (mPiPcdInfo == NULL) {
Status = gBS->LocateProtocol (&gEfiGetPcdInfoProtocolGuid, NULL, (VOID **)&mPiPcdInfo);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status)) {
return NULL;
}
ASSERT (mPiPcdInfo != NULL);
}
return mPiPcdInfo;
@ -110,6 +119,9 @@ GetPcdInfoProtocolPointer (
if (mPcdInfo == NULL) {
Status = gBS->LocateProtocol (&gGetPcdInfoProtocolGuid, NULL, (VOID **)&mPcdInfo);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status)) {
return NULL;
}
ASSERT (mPcdInfo != NULL);
}
return mPcdInfo;
@ -1134,6 +1146,9 @@ LibPcdSetEx64S (
)
{
ASSERT (Guid != NULL);
if (!Guid) {
return EFI_INVALID_PARAMETER;
}
return GetPiPcdProtocol()->Set64 (Guid, TokenNumber, Value);
}
@ -1172,6 +1187,9 @@ LibPcdSetExPtrS (
ASSERT (Guid != NULL);
ASSERT (SizeOfBuffer != NULL);
if (!Guid || !SizeOfBuffer) {
return EFI_INVALID_PARAMETER;
}
if (*SizeOfBuffer > 0) {
ASSERT (Buffer != NULL);
@ -1205,6 +1223,9 @@ LibPcdSetExBoolS (
)
{
ASSERT (Guid != NULL);
if (!Guid) {
return EFI_INVALID_PARAMETER;
}
return GetPiPcdProtocol()->SetBool (Guid, TokenNumber, Value);
}
@ -1233,12 +1254,12 @@ LibPcdCallbackOnSet (
IN PCD_CALLBACK NotificationFunction
)
{
EFI_STATUS Status;
// EFI_STATUS Status;
ASSERT (NotificationFunction != NULL);
Status = GetPiPcdProtocol()->CallbackOnSet (Guid, TokenNumber, (EFI_PCD_PROTOCOL_CALLBACK) NotificationFunction);
ASSERT_EFI_ERROR (Status);
/* Status = */GetPiPcdProtocol()->CallbackOnSet (Guid, TokenNumber, (EFI_PCD_PROTOCOL_CALLBACK) NotificationFunction);
// ASSERT_EFI_ERROR (Status);
return;
}
@ -1266,12 +1287,12 @@ LibPcdCancelCallback (
IN PCD_CALLBACK NotificationFunction
)
{
EFI_STATUS Status;
// EFI_STATUS Status;
ASSERT (NotificationFunction != NULL);
Status = GetPiPcdProtocol()->CancelCallback (Guid, TokenNumber, (EFI_PCD_PROTOCOL_CALLBACK) NotificationFunction);
ASSERT_EFI_ERROR (Status);
/* Status = */GetPiPcdProtocol()->CancelCallback (Guid, TokenNumber, (EFI_PCD_PROTOCOL_CALLBACK) NotificationFunction);
// ASSERT_EFI_ERROR (Status);
return;
}
@ -1308,6 +1329,9 @@ LibPcdGetNextToken (
Status = GetPiPcdProtocol()->GetNextToken (Guid, &TokenNumber);
ASSERT (!EFI_ERROR (Status) || TokenNumber == 0);
if (EFI_ERROR (Status)) {
TokenNumber = 0;
}
return TokenNumber;
}

View File

@ -808,6 +808,9 @@ DriverEfiVersionProtocolDumpInformation(
(VOID**)&DriverEfiVersion);
ASSERT_EFI_ERROR(Status);
if (EFI_ERROR(Status)) {
return NULL;
}
RetVal = AllocateZeroPool(VersionStringSize);
if (RetVal != NULL) {

View File

@ -1399,8 +1399,10 @@ ShellCommandCreateInitialMappingsAndPaths(
//
NewDefaultName = ShellCommandCreateNewMappingName(MappingTypeFileSystem);
ASSERT(NewDefaultName != NULL);
if (!NewDefaultName) break;
Status = ShellCommandAddMapItemAndUpdatePath(NewDefaultName, DevicePathList[Count], 0, TRUE);
ASSERT_EFI_ERROR(Status);
if (EFI_ERROR(Status)) break;
FreePool(NewDefaultName);
//
@ -1411,6 +1413,7 @@ ShellCommandCreateInitialMappingsAndPaths(
Status = ShellCommandAddMapItemAndUpdatePath(NewConsistName, DevicePathList[Count], 0, FALSE);
ASSERT_EFI_ERROR(Status);
FreePool(NewConsistName);
if (EFI_ERROR(Status)) break;
}
}

View File

@ -73,6 +73,9 @@ ShellCommandRunEndFor (
Status = CommandInit();
ASSERT_EFI_ERROR(Status);
if (EFI_ERROR(Status)) {
return Status;
}
if (!gEfiShellProtocol->BatchIsActive()) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"endfor");

View File

@ -1002,6 +1002,9 @@ ShellCommandRunElse (
Status = CommandInit ();
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status)) {
return Status;
}
if (gEfiShellParametersProtocol->Argc > 1) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if");
@ -1080,6 +1083,10 @@ ShellCommandRunEndIf (
Status = CommandInit ();
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR(Status)) {
return Status;
}
if (gEfiShellParametersProtocol->Argc > 1) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if");

View File

@ -34,6 +34,9 @@ ShellCommandRunShift (
Status = CommandInit();
ASSERT_EFI_ERROR(Status);
if (EFI_ERROR(Status)) {
return Status;
}
if (!gEfiShellProtocol->BatchIsActive()) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"shift");
@ -42,6 +45,9 @@ ShellCommandRunShift (
CurrentScriptFile = ShellCommandGetCurrentScriptFile();
ASSERT(CurrentScriptFile != NULL);
if (!CurrentScriptFile) {
return (SHELL_UNSUPPORTED);
}
if (CurrentScriptFile->Argc < 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"shift");

View File

@ -380,7 +380,7 @@ EFIAPI
ShellInitialize (
)
{
EFI_STATUS Status;
// EFI_STATUS Status;
//
// if auto initialize is not false then skip
@ -392,8 +392,8 @@ ShellInitialize (
//
// deinit the current stuff
//
Status = ShellLibDestructor (gImageHandle, gST);
ASSERT_EFI_ERROR (Status);
/* Status = */ShellLibDestructor (gImageHandle, gST);
// ASSERT_EFI_ERROR (Status);
//
// init the new stuff