summaryrefslogtreecommitdiff
path: root/source/components/parser/psobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/parser/psobject.c')
-rw-r--r--source/components/parser/psobject.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/components/parser/psobject.c b/source/components/parser/psobject.c
index 5d59492a7ba8..8f31750c5f7e 100644
--- a/source/components/parser/psobject.c
+++ b/source/components/parser/psobject.c
@@ -487,6 +487,31 @@ AcpiPsCreateOp (
{
Status = AcpiPsBuildNamedOp (WalkState, AmlOpStart, Op, &NamedOp);
AcpiPsFreeOp (Op);
+
+#ifdef ACPI_ASL_COMPILER
+ if (AcpiGbl_DisasmFlag && WalkState->Opcode == AML_EXTERNAL_OP &&
+ Status == AE_NOT_FOUND)
+ {
+ /*
+ * If parsing of AML_EXTERNAL_OP's name path fails, then skip
+ * past this opcode and keep parsing. This is a much better
+ * alternative than to abort the entire disassembler. At this
+ * point, the ParserState is at the end of the namepath of the
+ * external declaration opcode. Setting WalkState->Aml to
+ * WalkState->ParserState.Aml + 2 moves increments the
+ * WalkState->Aml past the object type and the paramcount of the
+ * external opcode. For the error message, only print the AML
+ * offset. We could attempt to print the name but this may cause
+ * a segmentation fault when printing the namepath because the
+ * AML may be incorrect.
+ */
+ AcpiOsPrintf (
+ "// Invalid external declaration at AML offset 0x%x.\n",
+ WalkState->Aml - WalkState->ParserState.AmlStart);
+ WalkState->Aml = WalkState->ParserState.Aml + 2;
+ return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE);
+ }
+#endif
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);