summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellLevel1CommandsLib
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-06-28 13:52:11 +0200
committerLaszlo Ersek <lersek@redhat.com>2016-06-30 17:27:15 +0200
commit4a7518d31a0254e4065d308f091bd7bc16dc8dba (patch)
tree8bcb038b198c79cc0a1b0f5d5800543cf0a684e0 /ShellPkg/Library/UefiShellLevel1CommandsLib
parent74e00be5c0cace9a6556f4bc9b5db70efb1d869e (diff)
downloadedk2-4a7518d31a0254e4065d308f091bd7bc16dc8dba.zip
edk2-4a7518d31a0254e4065d308f091bd7bc16dc8dba.tar.gz
edk2-4a7518d31a0254e4065d308f091bd7bc16dc8dba.tar.bz2
ShellPkg: don't call functions with side effects in ASSERT_EFI_ERROR()
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>
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel1CommandsLib')
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/If.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
index 7abfd89..dc96bff 100644
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
+++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
@@ -991,8 +991,11 @@ ShellCommandRunElse (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
+ EFI_STATUS Status;
SCRIPT_FILE *CurrentScriptFile;
- ASSERT_EFI_ERROR(CommandInit());
+
+ Status = CommandInit ();
+ ASSERT_EFI_ERROR (Status);
if (gEfiShellParametersProtocol->Argc > 1) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if");
@@ -1066,8 +1069,11 @@ ShellCommandRunEndIf (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
+ EFI_STATUS Status;
SCRIPT_FILE *CurrentScriptFile;
- ASSERT_EFI_ERROR(CommandInit());
+
+ Status = CommandInit ();
+ ASSERT_EFI_ERROR (Status);
if (gEfiShellParametersProtocol->Argc > 1) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if");