diff --git a/source/components/dispatcher/dsutils.c b/source/components/dispatcher/dsutils.c index afba711..4a49460 100644 --- a/source/components/dispatcher/dsutils.c +++ b/source/components/dispatcher/dsutils.c @@ -761,6 +761,8 @@ AcpiDsCreateOperands ( ACPI_PARSE_OBJECT *Arguments[ACPI_OBJ_NUM_OPERANDS]; UINT32 ArgCount = 0; UINT32 Index = WalkState->NumOperands; + UINT32 PrevNumOperands = WalkState->NumOperands; + UINT32 NewNumOperands; UINT32 i; @@ -793,6 +795,7 @@ AcpiDsCreateOperands ( /* Create the interpreter arguments, in reverse order */ + NewNumOperands = Index; Index--; for (i = 0; i < ArgCount; i++) { @@ -820,7 +823,11 @@ Cleanup: * pop everything off of the operand stack and delete those * objects */ - AcpiDsObjStackPopAndDelete (ArgCount, WalkState); + WalkState->NumOperands = i; + AcpiDsObjStackPopAndDelete (NewNumOperands, WalkState); + + /* Restore operand count */ + WalkState->NumOperands = PrevNumOperands; ACPI_EXCEPTION ((AE_INFO, Status, "While creating Arg %u", Index)); return_ACPI_STATUS (Status);