Skip to content

Commit

Permalink
Added check of varid against 0
Browse files Browse the repository at this point in the history
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1229 7335b38e-4728-0410-8992-fb3ffe349368
  • Loading branch information
jwang36 committed May 15, 2008
1 parent 0aa339a commit f297cf7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Source/C/VfrCompile/VfrSyntax.g
Expand Up @@ -534,7 +534,14 @@ vfrStatementVarStoreLinear :
)
{ Key "=" Number "," } // Key is used to assign Varid in Framework VFR but no use in UEFI2.1 VFR
{
VarId "=" ID:Number "," << VarStoreId = _STOU16(ID->getText()); >>
VarId "=" ID:Number "," <<
_PCATCH(
(INTN)(VarStoreId = _STOU16(ID->getText())) != 0,
(INTN)TRUE,
ID,
"varid 0 is not allowed."
);
>>
}
Name "=" SN:StringIdentifier ","
Uuid "=" guidDefinition[Guid]
Expand Down Expand Up @@ -2664,8 +2671,8 @@ EfiVfrParser::_GET_CURRQEST_VARSIZE (

VOID
EfiVfrParser::_PCATCH (
IN EFI_VFR_RETURN_CODE ReturnCode,
IN EFI_VFR_RETURN_CODE ExpectCode,
IN INTN ReturnCode,
IN INTN ExpectCode,
IN ANTLRTokenPtr Tok,
IN CHAR8 *ErrorMsg
)
Expand Down

0 comments on commit f297cf7

Please sign in to comment.