REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2686
The build tool will give an incorrect GUID value if the GUID includes character ' or " ASCII value.
This patch is going to fix this issue.
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
from Common.MultipleWorkspace import MultipleWorkspace as mws\r
from CommonDataClass.Exceptions import BadExpression\r
from Common.caching import cached_property\r
from Common.MultipleWorkspace import MultipleWorkspace as mws\r
from CommonDataClass.Exceptions import BadExpression\r
from Common.caching import cached_property\r
\r
ArrayIndex = re.compile("\[\s*[0-9a-fA-FxX]*\s*\]")\r
## Regular expression used to find out place holders in string template\r
\r
ArrayIndex = re.compile("\[\s*[0-9a-fA-FxX]*\s*\]")\r
## Regular expression used to find out place holders in string template\r
if Value[0] == '"' and Value[-1] == '"':\r
Value = Value[1:-1]\r
try:\r
if Value[0] == '"' and Value[-1] == '"':\r
Value = Value[1:-1]\r
try:\r
- Value = str(uuid.UUID(Value).bytes_le)\r
- if Value.startswith("b'"):\r
- Value = Value[2:-1]\r
- Value = "'" + Value + "'"\r
+ Value = uuid.UUID(Value).bytes_le\r
+ ValueL, ValueH = struct.unpack('2Q', Value)\r
+ Value = (ValueH << 64 ) | ValueL\r
+\r
except ValueError as Message:\r
raise BadExpression(Message)\r
except ValueError as Message:\r
raise BadExpression(Message)\r
- Value, Size = ParseFieldValue(Value)\r
return Value, 16\r
if Value.startswith('L"') and Value.endswith('"'):\r
# Unicode String\r
return Value, 16\r
if Value.startswith('L"') and Value.endswith('"'):\r
# Unicode String\r