summaryrefslogtreecommitdiff
path: root/source/components/parser
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/parser')
-rw-r--r--source/components/parser/psobject.c15
-rw-r--r--source/components/parser/psopcode.c2
-rw-r--r--source/components/parser/psparse.c14
3 files changed, 28 insertions, 3 deletions
diff --git a/source/components/parser/psobject.c b/source/components/parser/psobject.c
index 8d2448bd8d411..5d59492a7ba8f 100644
--- a/source/components/parser/psobject.c
+++ b/source/components/parser/psobject.c
@@ -237,12 +237,23 @@ AcpiPsGetAmlOpcode (
WalkState->Opcode,
(UINT32) (AmlOffset + sizeof (ACPI_TABLE_HEADER)));
+ ACPI_ERROR ((AE_INFO,
+ "Aborting disassembly, AML byte code is corrupt"));
+
/* Dump the context surrounding the invalid opcode */
AcpiUtDumpBuffer (((UINT8 *) WalkState->ParserState.Aml - 16),
48, DB_BYTE_DISPLAY,
(AmlOffset + sizeof (ACPI_TABLE_HEADER) - 16));
AcpiOsPrintf (" */\n");
+
+ /*
+ * Just abort the disassembly, cannot continue because the
+ * parser is essentially lost. The disassembler can then
+ * randomly fail because an ill-constructed parse tree
+ * can result.
+ */
+ return_ACPI_STATUS (AE_AML_BAD_OPCODE);
#endif
}
@@ -458,6 +469,10 @@ AcpiPsCreateOp (
{
return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE);
}
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
/* Create Op structure and append to parent's argument list */
diff --git a/source/components/parser/psopcode.c b/source/components/parser/psopcode.c
index 2ad29f19535f3..97a32544998d4 100644
--- a/source/components/parser/psopcode.c
+++ b/source/components/parser/psopcode.c
@@ -445,7 +445,7 @@ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] =
/* ACPI 6.0 opcodes */
-/* 81 */ ACPI_OP ("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE,/* ? */ AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R),
+/* 81 */ ACPI_OP ("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 82 */ ACPI_OP ("Comment", ARGP_COMMENT_OP, ARGI_COMMENT_OP, ACPI_TYPE_STRING, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT)
/*! [End] no source code translation !*/
diff --git a/source/components/parser/psparse.c b/source/components/parser/psparse.c
index 1a3a5345ccc59..854f054711f51 100644
--- a/source/components/parser/psparse.c
+++ b/source/components/parser/psparse.c
@@ -164,6 +164,7 @@
#include "acdispat.h"
#include "amlcode.h"
#include "acinterp.h"
+#include "acnamesp.h"
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psparse")
@@ -664,8 +665,17 @@ AcpiPsParseAml (
/* Either the method parse or actual execution failed */
AcpiExExitInterpreter ();
- ACPI_ERROR_METHOD ("Method parse/execution failed",
- WalkState->MethodNode, NULL, Status);
+ if (Status == AE_ABORT_METHOD)
+ {
+ AcpiNsPrintNodePathname (
+ WalkState->MethodNode, "Method aborted:");
+ AcpiOsPrintf ("\n");
+ }
+ else
+ {
+ ACPI_ERROR_METHOD ("Method parse/execution failed",
+ WalkState->MethodNode, NULL, Status);
+ }
AcpiExEnterInterpreter ();
/* Check for possible multi-thread reentrancy problem */