From b5513899b2931631456f61f5152279d4d505d988 Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Fri, 2 Aug 2013 12:07:32 -0700 Subject: Parser: Fix handling of NULL target operands. This is an update to the previous commit to support method invocation as a target operand. Handle the case where an optional target is not specified in the ASL. --- source/components/parser/psargs.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/source/components/parser/psargs.c b/source/components/parser/psargs.c index fc06e4f72..af538f828 100644 --- a/source/components/parser/psargs.c +++ b/source/components/parser/psargs.c @@ -915,6 +915,29 @@ AcpiPsGetNextArg ( case ARGP_TARGET: case ARGP_SUPERNAME: case ARGP_SIMPLENAME: + + /* + * Handle the case for a null target or name. + * Note: The parser inserts a Zero node for an optional target + * that is not specified in the source ASL. + */ + if (AcpiPsPeekOpcode (ParserState) == 0) + { + Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP); + if (!Arg) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + Status = AcpiPsGetNextNamepath (WalkState, ParserState, Arg, 0); + break; + } + + /* Single complex argument, nothing returned */ + + WalkState->ArgCount = 1; + break; + case ARGP_DATAOBJ: case ARGP_TERMARG: /* -- cgit v1.2.1