summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Common/Misc.py
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python/Common/Misc.py')
-rw-r--r--BaseTools/Source/Python/Common/Misc.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index b34cb4c3be..d80f645d2e 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -1572,6 +1572,8 @@ def ParseFieldValue (Value):
if Value.startswith("L'") and Value.endswith("'"):
# Unicode Character Constant
List = list(Value[2:-1])
+ if len(List) == 0:
+ raise BadExpression('Length %s is %s' % (Value, len(List)))
List.reverse()
Value = 0
for Char in List:
@@ -1580,6 +1582,8 @@ def ParseFieldValue (Value):
if Value.startswith("'") and Value.endswith("'"):
# Character constant
List = list(Value[1:-1])
+ if len(List) == 0:
+ raise BadExpression('Length %s is %s' % (Value, len(List)))
List.reverse()
Value = 0
for Char in List: