summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-06-28 13:52:11 +0200
committerHao Wu <hao.a.wu@intel.com>2016-07-13 20:43:46 +0800
commitfbd754a861ba1837c95d09dea8fdf455bd238ccf (patch)
treeb804816899f31a26d06525fe6e7383f6d1a9bed0 /ShellPkg/Library
parent312f112538a0c469239c88943493a0133d6ba110 (diff)
downloadedk2-fbd754a861ba1837c95d09dea8fdf455bd238ccf.tar.gz
edk2-fbd754a861ba1837c95d09dea8fdf455bd238ccf.tar.bz2
edk2-fbd754a861ba1837c95d09dea8fdf455bd238ccf.zip
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> (cherry picked from commit 4a7518d31a0254e4065d308f091bd7bc16dc8dba)
Diffstat (limited to 'ShellPkg/Library')
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/If.c10
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c5
2 files changed, 12 insertions, 3 deletions
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
index 7abfd8944b..dc96bffde7 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");
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index cf89a4ac87..35a1a7169c 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -373,6 +373,8 @@ EFIAPI
ShellInitialize (
)
{
+ EFI_STATUS Status;
+
//
// if auto initialize is not false then skip
//
@@ -383,7 +385,8 @@ ShellInitialize (
//
// deinit the current stuff
//
- ASSERT_EFI_ERROR(ShellLibDestructor(gImageHandle, gST));
+ Status = ShellLibDestructor (gImageHandle, gST);
+ ASSERT_EFI_ERROR (Status);
//
// init the new stuff