summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Common
diff options
context:
space:
mode:
authorFan, ZhijuX <zhijux.fan@intel.com>2019-05-09 17:19:56 +0800
committerFeng, Bob C <bob.c.feng@intel.com>2019-05-10 17:06:44 +0800
commitafe8c4110c072126b9fb3821397a0216bf7dd8ad (patch)
tree853f1fc2abaa6022bf993c4034ef249b8a879569 /BaseTools/Source/Python/Common
parent70023bab7efe1147402bcb8d31378f949c4527f6 (diff)
downloadedk2-afe8c4110c072126b9fb3821397a0216bf7dd8ad.tar.gz
edk2-afe8c4110c072126b9fb3821397a0216bf7dd8ad.tar.bz2
edk2-afe8c4110c072126b9fb3821397a0216bf7dd8ad.zip
BaseTools: Correct the value assignment for StructurePcd
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1752 This patch is to fix the code bug in StructurePcd overall value assignment logic. If a Pcd Array size is fixed but the size of actual value in Dsc or Dec is bigger than the Pcd array size, the tool will report error about such setting and stop build. The patch is tested minplatform, Ovmf, structure pcd regression test These tests are build pass. The patch also tested the following cases. Our cases focused on PcdArraySize. 1.flexiable PcdArraySize. 2.Fixed PcdArraySize, Pcd overall value exceeds the size of PcdArray. 3.Fixed PcdArraySize, Pcd overall value Not exceeds the size of PcdArray. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Common')
-rw-r--r--BaseTools/Source/Python/Common/Misc.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index 3b3ab2d6df..0e0cb45ebe 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -37,6 +37,7 @@ from Common.MultipleWorkspace import MultipleWorkspace as mws
from CommonDataClass.Exceptions import BadExpression
from Common.caching import cached_property
+ArrayIndex = re.compile("\[\s*[0-9a-fA-FxX]*\s*\]")
## Regular expression used to find out place holders in string template
gPlaceholderPattern = re.compile("\$\{([^$()\s]+)\}", re.MULTILINE | re.UNICODE)