Added check of varid against 0
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 15 May 2008 03:33:11 +0000 (03:33 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 15 May 2008 03:33:11 +0000 (03:33 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1229 7335b38e-4728-0410-8992-fb3ffe349368

Source/C/VfrCompile/VfrSyntax.g

index e6918e9..abaadc1 100644 (file)
@@ -534,7 +534,14 @@ vfrStatementVarStoreLinear :
   )\r
   { Key "=" Number "," }                            // Key is used to assign Varid in Framework VFR but no use in UEFI2.1 VFR\r
   {\r
-    VarId "=" ID:Number ","                         << VarStoreId = _STOU16(ID->getText()); >>\r
+    VarId "=" ID:Number ","                         <<\r
+                                                       _PCATCH(\r
+                                                         (INTN)(VarStoreId = _STOU16(ID->getText())) != 0,\r
+                                                         (INTN)TRUE,\r
+                                                         ID,\r
+                                                         "varid 0 is not allowed."\r
+                                                         );\r
+                                                    >>\r
   }\r
   Name "=" SN:StringIdentifier ","\r
   Uuid "=" guidDefinition[Guid]\r
@@ -2664,8 +2671,8 @@ EfiVfrParser::_GET_CURRQEST_VARSIZE (
 \r
 VOID\r
 EfiVfrParser::_PCATCH (\r
-  IN EFI_VFR_RETURN_CODE ReturnCode,\r
-  IN EFI_VFR_RETURN_CODE ExpectCode,\r
+  IN INTN                ReturnCode,\r
+  IN INTN                ExpectCode,\r
   IN ANTLRTokenPtr       Tok,\r
   IN CHAR8               *ErrorMsg\r
   )\r