MdePkg PcdLib: Follow the comment of LibPcdGetNextToken to ASSERT when an invalid...
authorStar Zeng <star.zeng@intel.com>
Mon, 23 Dec 2013 06:41:36 +0000 (06:41 +0000)
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 23 Dec 2013 06:41:36 +0000 (06:41 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15016 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/DxePcdLib/DxePcdLib.c
MdePkg/Library/PeiPcdLib/PeiPcdLib.c

index bc87c4e..f14a746 100644 (file)
@@ -1002,7 +1002,10 @@ LibPcdGetNextToken (
   IN UINTN                    TokenNumber\r
   )\r
 {\r
-  GetPiPcdProtocol()->GetNextToken (Guid, &TokenNumber);\r
+  EFI_STATUS    Status;\r
+\r
+  Status = GetPiPcdProtocol()->GetNextToken (Guid, &TokenNumber);\r
+  ASSERT (!EFI_ERROR (Status) || TokenNumber == 0);\r
 \r
   return TokenNumber;\r
 }\r
index a57751f..31ff457 100644 (file)
@@ -1010,7 +1010,10 @@ LibPcdGetNextToken (
   IN UINTN                    TokenNumber\r
   )\r
 {\r
-  (GetPiPcdPpiPointer ())->GetNextToken (Guid, &TokenNumber);\r
+  EFI_STATUS    Status;\r
+\r
+  Status = (GetPiPcdPpiPointer ())->GetNextToken (Guid, &TokenNumber);\r
+  ASSERT (!EFI_ERROR (Status) || TokenNumber == 0);\r
 \r
   return TokenNumber;\r
 }\r