summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-10-26 07:32:20 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-10-26 07:32:20 +0000
commit49e70927147f49c388b9e6a383728f7df48ed4c7 (patch)
treeb3bf39e6d50ad1bb0f62def1f9a69cb94524d54d
parent18e6a25f7bf14f2a30a92abbb570ada31619db22 (diff)
downloadedk2-platforms-49e70927147f49c388b9e6a383728f7df48ed4c7.tar.xz
Add in local variable to ensure that "operands are evaluated in specified order".
Otherwise, Intel ICC report "operands are evaluated in unspecified order" build error. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6231 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index b5741785b2..bc4e6eb38d 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -606,12 +606,16 @@ Returns:
UINT8 *ValidBuffer;
UINTN MaximumBufferSize;
UINTN VariableSize;
+ UINTN VariableNameSize;
+ UINTN UpdatingVariableNameSize;
UINTN NameSize;
UINT8 *CurrPtr;
VOID *Point0;
VOID *Point1;
BOOLEAN FoundAdded;
EFI_STATUS Status;
+ CHAR16 *VariableNamePtr;
+ CHAR16 *UpdatingVariableNamePtr;
VariableStoreHeader = (VARIABLE_STORE_HEADER *) ((UINTN) VariableBase);
@@ -667,9 +671,15 @@ Returns:
Variable = NextVariable;
continue;
}
+
+ VariableNameSize = NameSizeOfVariable(Variable);
+ UpdatingVariableNameSize = NameSizeOfVariable(UpdatingVariable);
+
+ VariableNamePtr = GetVariableNamePtr (Variable);
+ UpdatingVariableNamePtr = GetVariableNamePtr (UpdatingVariable);
if (CompareGuid (&Variable->VendorGuid, &UpdatingVariable->VendorGuid) &&
- NameSizeOfVariable(Variable) == NameSizeOfVariable (UpdatingVariable) &&
- CompareMem (GetVariableNamePtr (Variable), GetVariableNamePtr (UpdatingVariable), NameSizeOfVariable (Variable)) == 0 ) {
+ VariableNameSize == UpdatingVariableNameSize &&
+ CompareMem (VariableNamePtr, UpdatingVariableNamePtr, VariableNameSize) == 0 ) {
Variable = NextVariable;
continue;
}