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 <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
This commit is contained in:
Star Zeng 2013-12-23 06:41:36 +00:00 committed by lzeng14
parent adcd7381bb
commit da660118bd
2 changed files with 8 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}