From c8028b862da5e2816744dd210d639421954a02f5 Mon Sep 17 00:00:00 2001 From: Erik Schmauss Date: Fri, 30 Aug 2019 11:36:25 -0700 Subject: [PATCH 1/2] iASL: DT: detect invalid field labels Signed-off-by: Erik Schmauss --- source/compiler/aslmessages.c | 3 ++- source/compiler/aslmessages.h | 1 + source/compiler/dtcompile.c | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/source/compiler/aslmessages.c b/source/compiler/aslmessages.c index 8dd989ca9..c36b268d1 100644 --- a/source/compiler/aslmessages.c +++ b/source/compiler/aslmessages.c @@ -387,7 +387,8 @@ const char *AslTableCompilerMsgs [] = /* ASL_MSG_UNKNOWN_LABEL */ "Label is undefined", /* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type", /* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature", -/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero" +/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero", +/* ASL_MSG_INVALID_LABEL */ "Invalid field label detected" }; /* Preprocessor */ diff --git a/source/compiler/aslmessages.h b/source/compiler/aslmessages.h index 55473fb53..8da577345 100644 --- a/source/compiler/aslmessages.h +++ b/source/compiler/aslmessages.h @@ -387,6 +387,7 @@ typedef enum ASL_MSG_UNKNOWN_SUBTABLE, ASL_MSG_UNKNOWN_TABLE, ASL_MSG_ZERO_VALUE, + ASL_MSG_INVALID_LABEL, /* These messages are used by the Preprocessor only */ diff --git a/source/compiler/dtcompile.c b/source/compiler/dtcompile.c index e56dfd489..bdd8c1b70 100644 --- a/source/compiler/dtcompile.c +++ b/source/compiler/dtcompile.c @@ -646,6 +646,14 @@ DtCompileTable ( FieldType = DtGetFieldType (Info); AslGbl_InputFieldCount++; + if (FieldType != DT_FIELD_TYPE_INLINE_SUBTABLE && + strcmp (Info->Name, LocalField->Name)) + { + sprintf (AslGbl_MsgBuffer, "found \"%s\" expected \"%s\"", + LocalField->Name, Info->Name); + DtError (ASL_ERROR, ASL_MSG_INVALID_LABEL, LocalField, AslGbl_MsgBuffer); + } + switch (FieldType) { case DT_FIELD_TYPE_FLAGS_INTEGER: From 8d4d38050a1015fe011795ccfe23d51682a7d237 Mon Sep 17 00:00:00 2001 From: Erik Schmauss Date: Fri, 30 Aug 2019 11:49:35 -0700 Subject: [PATCH 2/2] iASL: DT: change disassembly of STAO to match the STAO info tabel Signed-off-by: Erik Schmauss --- source/common/dmtbdump3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/dmtbdump3.c b/source/common/dmtbdump3.c index ce3394e5b..561a0032a 100644 --- a/source/common/dmtbdump3.c +++ b/source/common/dmtbdump3.c @@ -410,7 +410,7 @@ AcpiDmDumpStao ( Namepath = ACPI_ADD_PTR (char, Table, Offset); StringLength = strlen (Namepath) + 1; - AcpiDmLineHeader (Offset, StringLength, "Namestring"); + AcpiDmLineHeader (Offset, StringLength, "Namepath"); AcpiOsPrintf ("\"%s\"\n", Namepath); /* Point to next namepath */