summaryrefslogtreecommitdiff
path: root/BaseTools/Source
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2015-01-08 08:36:05 +0000
committerydong10 <ydong10@Edk2>2015-01-08 08:36:05 +0000
commit5c7956a2a3324ef47e95f3a350e901b2ddfef69c (patch)
tree1078cf6a78eae7d03889dc300fb8915a198c1a2a /BaseTools/Source
parent92ca0c6721d6475d9125c3b64f429cde0777fe28 (diff)
downloadedk2-platforms-5c7956a2a3324ef47e95f3a350e901b2ddfef69c.tar.xz
Fixed VfrCompile crash on efivarstore statement.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Aaron Pop <aaronp@ami.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16591 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source')
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrSyntax.g7
1 files changed, 6 insertions, 1 deletions
diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
index 1a5b3fd588..2255d6f60b 100644
--- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g
+++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
@@ -917,10 +917,11 @@ vfrStatementVarStoreEfi :
CHAR8 *TypeName;
UINT32 LineNum;
CHAR8 *StoreName = NULL;
+ BOOLEAN CustomizedName = FALSE;
>>
E:Efivarstore << VSEObj.SetLineNo(E->getLine()); >>
(
- TN:StringIdentifier "," << TypeName = TN->getText(); LineNum = TN->getLine(); >>
+ TN:StringIdentifier "," << TypeName = TN->getText(); LineNum = TN->getLine(); CustomizedName = TRUE; >>
| U8:"UINT8" "," << TypeName = U8->getText(); LineNum = U8->getLine(); >>
| U16:"UINT16" "," << TypeName = U16->getText(); LineNum = U16->getLine(); >>
| C16:"CHAR16" "," << TypeName = (CHAR8 *) "UINT16"; LineNum = C16->getLine(); >>
@@ -953,6 +954,10 @@ vfrStatementVarStoreEfi :
if (StoreName == NULL) {
_PCATCH (VFR_RETURN_UNSUPPORTED, VN->getLine(), "Can't get varstore name for this StringId!");
}
+ if (!CustomizedName) {
+ _PCATCH (VFR_RETURN_UNSUPPORTED, E->getLine(), "Old style efivarstore must have String Identifier!");
+ return;
+ }
Size = _STOU32(N->getText(), N->getLine());
switch (Size) {
case 1: