summaryrefslogtreecommitdiff
path: root/source/components/disassembler
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/disassembler')
-rw-r--r--source/components/disassembler/dmcstyle.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/source/components/disassembler/dmcstyle.c b/source/components/disassembler/dmcstyle.c
index 04436a846c03..7616723d9a9e 100644
--- a/source/components/disassembler/dmcstyle.c
+++ b/source/components/disassembler/dmcstyle.c
@@ -227,12 +227,27 @@ AcpiDmCheckForSymbolicOpcode (
Child2->Common.OperatorSymbol = OperatorSymbol;
return (TRUE);
-#ifdef INDEX_SUPPORT
case AML_INDEX_OP:
+ /*
+ * Check for constant source operand. Note: although technically
+ * legal syntax, the iASL compiler does not support this with
+ * the symbolic operators for Index(). It doesn't make sense to
+ * use Index() with a constant anyway.
+ */
+ if ((Child1->Common.AmlOpcode == AML_STRING_OP) ||
+ (Child1->Common.AmlOpcode == AML_BUFFER_OP) ||
+ (Child1->Common.AmlOpcode == AML_PACKAGE_OP) ||
+ (Child1->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
+ {
+ Op->Common.DisasmFlags |= ACPI_PARSEOP_CLOSING_PAREN;
+ return (FALSE);
+ }
+
+ /* Index operator is [] */
+
Child1->Common.OperatorSymbol = " [";
Child2->Common.OperatorSymbol = "]";
break;
-#endif
/* Unary operators */
@@ -442,7 +457,6 @@ AcpiDmCheckForSymbolicOpcode (
case AML_INCREMENT_OP:
return (TRUE);
-#ifdef INDEX_SUPPORT
case AML_INDEX_OP:
/* Target is optional, 3rd operand */
@@ -458,7 +472,6 @@ AcpiDmCheckForSymbolicOpcode (
}
}
return (TRUE);
-#endif
case AML_STORE_OP:
/*
@@ -578,12 +591,18 @@ AcpiDmCloseOperator (
}
break;
+ case AML_INDEX_OP:
+
+ /* This is case for unsupported Index() source constants */
+
+ if (Op->Common.DisasmFlags & ACPI_PARSEOP_CLOSING_PAREN)
+ {
+ AcpiOsPrintf (")");
+ }
+ return;
/* No need for parens for these */
-#ifdef INDEX_SUPPORT
- case AML_INDEX_OP:
-#endif
case AML_DECREMENT_OP:
case AML_INCREMENT_OP:
case AML_LNOT_OP: