summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Moore <Robert.Moore@intel.com>2016-09-23 13:17:24 -0700
committerRobert Moore <Robert.Moore@intel.com>2016-09-23 13:17:24 -0700
commitbe9a1059d4373dab853f751c0fb175bbfe67d235 (patch)
tree364c4c3ee889dc2a78c8b406e2bdd5a9ef08ecba
parent72910e63ce98a9a39a04e173ebdbe83f90e42bec (diff)
downloadacpica-be9a1059d4373dab853f751c0fb175bbfe67d235.tar.gz
iASL: Optimization for FieldUnit lists
Ignore a field unit that is both unnamed and has a length of zero. Previously, two zero bytes were emitted for no good reason.
-rw-r--r--source/compiler/asloperands.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/compiler/asloperands.c b/source/compiler/asloperands.c
index 2e2f2d108..db4d013c1 100644
--- a/source/compiler/asloperands.c
+++ b/source/compiler/asloperands.c
@@ -423,6 +423,20 @@ OpnDoFieldCommon (
NewBitOffset = (UINT32) PkgLengthNode->Asl.Value.Integer;
CurrentBitOffset += NewBitOffset;
+ if ((NewBitOffset == 0) &&
+ (Next->Asl.ParseOpcode == PARSEOP_RESERVED_BYTES))
+ {
+ /*
+ * Unnamed field with a bit length of zero. We can
+ * safely just ignore this. However, we will not ignore
+ * a named field of zero length, we don't want to just
+ * toss out a name.
+ */
+ Next->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+ PkgLengthNode->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+ break;
+ }
+
/* Save the current AccessAs value for error checking later */
switch (AccessType)