]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: don't call functions with side effects in ASSERT_EFI_ERROR()
authorLaszlo Ersek <lersek@redhat.com>
Tue, 28 Jun 2016 11:52:11 +0000 (13:52 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Thu, 30 Jun 2016 15:27:15 +0000 (17:27 +0200)
When ASSERT_EFI_ERROR() is compiled out, dependent on build flags, only
the status checking should be removed; the function calls should stay.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Shumin Qiu <shumin.qiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
ShellPkg/Library/UefiShellLib/UefiShellLib.c

index 7abfd8944b92997501c2a913939d434aeff4a692..dc96bffde7d3b0ef19459a1c0c87459e3545c993 100644 (file)
@@ -991,8 +991,11 @@ ShellCommandRunElse (
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 {\r
+  EFI_STATUS  Status;\r
   SCRIPT_FILE *CurrentScriptFile;\r
-  ASSERT_EFI_ERROR(CommandInit());\r
+\r
+  Status = CommandInit ();\r
+  ASSERT_EFI_ERROR (Status);\r
 \r
   if (gEfiShellParametersProtocol->Argc > 1) {\r
     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if");  \r
@@ -1066,8 +1069,11 @@ ShellCommandRunEndIf (
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 {\r
+  EFI_STATUS  Status;\r
   SCRIPT_FILE *CurrentScriptFile;\r
-  ASSERT_EFI_ERROR(CommandInit());\r
+\r
+  Status = CommandInit ();\r
+  ASSERT_EFI_ERROR (Status);\r
 \r
   if (gEfiShellParametersProtocol->Argc > 1) {\r
     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if");  \r
index cf89a4ac87edb844ad2bfe3962bec4f3ec09e874..35a1a7169c8b9dbdf7b287052a6fb34eb57f2cee 100644 (file)
@@ -373,6 +373,8 @@ EFIAPI
 ShellInitialize (\r
   )\r
 {\r
+  EFI_STATUS Status;\r
+\r
   //\r
   // if auto initialize is not false then skip\r
   //\r
@@ -383,7 +385,8 @@ ShellInitialize (
   //\r
   // deinit the current stuff\r
   //\r
-  ASSERT_EFI_ERROR(ShellLibDestructor(gImageHandle, gST));\r
+  Status = ShellLibDestructor (gImageHandle, gST);\r
+  ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
   // init the new stuff\r