From da660118bd391d1f421f99921f9f15a66a8fc7ea Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Mon, 23 Dec 2013 06:41:36 +0000 Subject: MdePkg PcdLib: Follow the comment of LibPcdGetNextToken to ASSERT when an invalid TokenNumber input. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15016 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/DxePcdLib/DxePcdLib.c | 5 ++++- MdePkg/Library/PeiPcdLib/PeiPcdLib.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'MdePkg') diff --git a/MdePkg/Library/DxePcdLib/DxePcdLib.c b/MdePkg/Library/DxePcdLib/DxePcdLib.c index bc87c4e6a1..f14a746529 100644 --- a/MdePkg/Library/DxePcdLib/DxePcdLib.c +++ b/MdePkg/Library/DxePcdLib/DxePcdLib.c @@ -1002,7 +1002,10 @@ LibPcdGetNextToken ( IN UINTN TokenNumber ) { - GetPiPcdProtocol()->GetNextToken (Guid, &TokenNumber); + EFI_STATUS Status; + + Status = GetPiPcdProtocol()->GetNextToken (Guid, &TokenNumber); + ASSERT (!EFI_ERROR (Status) || TokenNumber == 0); return TokenNumber; } diff --git a/MdePkg/Library/PeiPcdLib/PeiPcdLib.c b/MdePkg/Library/PeiPcdLib/PeiPcdLib.c index a57751f412..31ff457fc8 100644 --- a/MdePkg/Library/PeiPcdLib/PeiPcdLib.c +++ b/MdePkg/Library/PeiPcdLib/PeiPcdLib.c @@ -1010,7 +1010,10 @@ LibPcdGetNextToken ( IN UINTN TokenNumber ) { - (GetPiPcdPpiPointer ())->GetNextToken (Guid, &TokenNumber); + EFI_STATUS Status; + + Status = (GetPiPcdPpiPointer ())->GetNextToken (Guid, &TokenNumber); + ASSERT (!EFI_ERROR (Status) || TokenNumber == 0); return TokenNumber; } -- cgit v1.2.3