diff --git a/interpreter/executer/exresnte.c b/interpreter/executer/exresnte.c index e953927..d835d09 100755 --- a/interpreter/executer/exresnte.c +++ b/interpreter/executer/exresnte.c @@ -337,6 +337,7 @@ AcpiExResolveNodeToValue ( /* Return an additional reference to the object */ case AML_REF_OF_OP: + case AML_INDEX_OP: ObjDesc = SourceDesc; AcpiUtAddReference (ObjDesc); diff --git a/interpreter/executer/exresolv.c b/interpreter/executer/exresolv.c index dae1eb4..f8f43a9 100755 --- a/interpreter/executer/exresolv.c +++ b/interpreter/executer/exresolv.c @@ -286,28 +286,34 @@ AcpiExResolveObjectToValue ( case ACPI_TYPE_PACKAGE: - ObjDesc = *StackDesc->Reference.Where; - if (ObjDesc) - { - /* - * Valid obj descriptor, copy pointer to return value - * (i.e., dereference the package index) - * Delete the ref object, increment the returned object - */ - AcpiUtRemoveReference (StackDesc); - AcpiUtAddReference (ObjDesc); - *StackPtr = ObjDesc; - } - else + /* If method call or CopyObject - leave the Reference on the stack */ + + if (WalkState->Opcode != AML_INT_METHODCALL_OP && + WalkState->Opcode != AML_COPY_OP) { - /* - * A NULL object descriptor means an unitialized element of - * the package, can't dereference it - */ - ACPI_ERROR ((AE_INFO, - "Attempt to deref an Index to NULL pkg element Idx=%p", - StackDesc)); - Status = AE_AML_UNINITIALIZED_ELEMENT; + ObjDesc = *StackDesc->Reference.Where; + if (ObjDesc) + { + /* + * Valid obj descriptor, copy pointer to return value + * (i.e., dereference the package index) + * Delete the ref object, increment the returned object + */ + AcpiUtRemoveReference (StackDesc); + AcpiUtAddReference (ObjDesc); + *StackPtr = ObjDesc; + } + else + { + /* + * A NULL object descriptor means an unitialized element of + * the package, can't dereference it + */ + ACPI_ERROR ((AE_INFO, + "Attempt to deref an Index to NULL pkg element Idx=%p", + StackDesc)); + Status = AE_AML_UNINITIALIZED_ELEMENT; + } } break;