summaryrefslogtreecommitdiff
path: root/source/components/disassembler/dmopcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/disassembler/dmopcode.c')
-rw-r--r--source/components/disassembler/dmopcode.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c
index 8f163ca7e5e2e..f4d13191c2f81 100644
--- a/source/components/disassembler/dmopcode.c
+++ b/source/components/disassembler/dmopcode.c
@@ -249,11 +249,11 @@ AcpiDmPredefinedDescription (
/* Ensure that the comment field is emitted only once */
- if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEF_CHECKED)
+ if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEFINED_CHECKED)
{
return;
}
- Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEF_CHECKED;
+ Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEFINED_CHECKED;
/* Predefined name must start with an underscore */
@@ -385,11 +385,11 @@ AcpiDmFieldPredefinedDescription (
/* Ensure that the comment field is emitted only once */
- if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEF_CHECKED)
+ if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEFINED_CHECKED)
{
return;
}
- Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEF_CHECKED;
+ Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEFINED_CHECKED;
/*
* Op must be one of the Create* operators: CreateField, CreateBitField,
@@ -1051,10 +1051,16 @@ AcpiDmConvertToElseIf (
ACPI_PARSE_OBJECT *ElseOp;
- /* Examine the first child of the Else */
-
+ /*
+ * To be able to perform the conversion, two conditions must be satisfied:
+ * 1) The first child of the Else must be an If statement.
+ * 2) The If block can only be followed by an Else block and these must
+ * be the only blocks under the original Else.
+ */
IfOp = OriginalElseOp->Common.Value.Arg;
- if (!IfOp || (IfOp->Common.AmlOpcode != AML_IF_OP))
+ if (!IfOp ||
+ (IfOp->Common.AmlOpcode != AML_IF_OP) ||
+ (IfOp->Asl.Next && (IfOp->Asl.Next->Common.AmlOpcode != AML_ELSE_OP)))
{
/* Not an Else..If sequence, cannot convert to ElseIf */