]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix parse OFFSET_OF get wrong offset
authorFeng, YunhuaX </o=Intel/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Feng, YunhuaX4e1>
Fri, 9 Mar 2018 08:46:00 +0000 (16:46 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Fri, 9 Mar 2018 09:34:10 +0000 (17:34 +0800)
Fix parse OFFSET_OF get wrong offset

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/Common/Expression.py

index 79dc83efc3d5670d9dc278bc06d488402d359a56..e76f09c367c19a102d06a6ee94d4061a4e33fcc3 100644 (file)
@@ -909,8 +909,9 @@ class ValueExpressionEx(ValueExpression):
                         LabelOffset = 0\r
                         for Index, Item in enumerate(PcdValueList):\r
                             # compute byte offset of every LABEL\r
                         LabelOffset = 0\r
                         for Index, Item in enumerate(PcdValueList):\r
                             # compute byte offset of every LABEL\r
-                            Item = Item.strip()\r
                             LabelList = ReLabel.findall(Item)\r
                             LabelList = ReLabel.findall(Item)\r
+                            Item = ReLabel.sub('', Item)\r
+                            Item = Item.strip()\r
                             if LabelList:\r
                                 for Label in LabelList:\r
                                     if not IsValidCString(Label):\r
                             if LabelList:\r
                                 for Label in LabelList:\r
                                     if not IsValidCString(Label):\r