Revision: 16591
          http://sourceforge.net/p/edk2/code/16591
Author:   ydong10
Date:     2015-01-08 08:36:05 +0000 (Thu, 08 Jan 2015)
Log Message:
-----------
Fixed VfrCompile crash on efivarstore statement.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <[email protected]>
Reviewed-by: Aaron Pop <[email protected]>

Modified Paths:
--------------
    trunk/edk2/BaseTools/Source/C/VfrCompile/VfrSyntax.g

Modified: trunk/edk2/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- trunk/edk2/BaseTools/Source/C/VfrCompile/VfrSyntax.g        2015-01-08 
05:41:56 UTC (rev 16590)
+++ trunk/edk2/BaseTools/Source/C/VfrCompile/VfrSyntax.g        2015-01-08 
08:36:05 UTC (rev 16591)
@@ -917,10 +917,11 @@
      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 @@
                                                        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:


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to