diff options
Diffstat (limited to 'source/compiler/aslexternal.c')
| -rw-r--r-- | source/compiler/aslexternal.c | 61 |
1 files changed, 34 insertions, 27 deletions
diff --git a/source/compiler/aslexternal.c b/source/compiler/aslexternal.c index 5335048adaa3d..a814efddd5460 100644 --- a/source/compiler/aslexternal.c +++ b/source/compiler/aslexternal.c @@ -146,6 +146,7 @@ ExInsertArgCount ( char * ExternalName; char * CallName; UINT16 ArgCount = 0; + ACPI_STATUS Status; CallName = AcpiNsGetNormalizedPathname (Op->Asl.Node, TRUE); @@ -166,43 +167,49 @@ ExInsertArgCount ( NameOp = Next->Asl.Child->Asl.Child; ExternalName = AcpiNsGetNormalizedPathname (NameOp->Asl.Node, TRUE); - if (!strcmp (CallName, ExternalName)) + if (strcmp (CallName, ExternalName)) { - Next->Asl.Child->Asl.CompileFlags |= NODE_VISITED; + ACPI_FREE (ExternalName); + Next = Next->Asl.Next; + continue; + } - /* - * Since we will reposition Externals to the Root, set Namepath - * to the fully qualified name and recalculate the aml length - */ - if (ACPI_FAILURE (UtInternalizeName ( - ExternalName, &NameOp->Asl.Value.String))) - { - AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, - NULL, "- Could not Internalize External"); + Next->Asl.Child->Asl.CompileFlags |= NODE_VISITED; - break; - } - - NameOp->Asl.AmlLength = strlen (NameOp->Asl.Value.String); + /* + * Since we will reposition Externals to the Root, set Namepath + * to the fully qualified name and recalculate the aml length + */ + Status = UtInternalizeName (ExternalName, + &NameOp->Asl.Value.String); - /* Get argument count */ + ACPI_FREE (ExternalName); + if (ACPI_FAILURE (Status)) + { + AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, + NULL, "- Could not Internalize External"); + break; + } - Child = Op->Asl.Child; - while (Child) - { - ArgCount++; - Child = Child->Asl.Next; - } + NameOp->Asl.AmlLength = strlen (NameOp->Asl.Value.String); - /* Setup ArgCount operand */ + /* Get argument count */ - ArgCountOp = Next->Asl.Child->Asl.Child->Asl.Next->Asl.Next; - ArgCountOp->Asl.Value.Integer = ArgCount; - break; + Child = Op->Asl.Child; + while (Child) + { + ArgCount++; + Child = Child->Asl.Next; } - Next = Next->Asl.Next; + /* Setup ArgCount operand */ + + ArgCountOp = Next->Asl.Child->Asl.Child->Asl.Next->Asl.Next; + ArgCountOp->Asl.Value.Integer = ArgCount; + break; } + + ACPI_FREE (CallName); } |
