From d7d9d66bf64de26c72a34f14e6f6722c0ed5e5a7 Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Fri, 7 Dec 2012 14:13:01 -0800 Subject: [PATCH] Interpreter: Fix Store() when implicit conversion is not possible For the cases such as a store of a string to an existing package object, implement the store as a CopyObject(). This is a small departure from the ACPI specification which states that the control method should be aborted in this case. However, ASLTS suite depends on this behavior. --- source/components/executer/exstore.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/source/components/executer/exstore.c b/source/components/executer/exstore.c index 668de4a22..e2335a855 100644 --- a/source/components/executer/exstore.c +++ b/source/components/executer/exstore.c @@ -587,13 +587,28 @@ AcpiExStoreObjectToNode ( default: ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Storing %s (%p) directly into node (%p) with no implicit conversion\n", - AcpiUtGetObjectTypeName (SourceDesc), SourceDesc, Node)); + "Storing [%s] (%p) directly into node [%s] (%p)" + " with no implicit conversion\n", + AcpiUtGetObjectTypeName (SourceDesc), SourceDesc, + AcpiUtGetObjectTypeName (TargetDesc), Node)); - /* No conversions for all other types. Just attach the source object */ + /* + * No conversions for all other types. Directly store a copy of + * the source object. NOTE: This is a departure from the ACPI + * spec, which states "If conversion is impossible, abort the + * running control method". + * + * This code implements "If conversion is impossible, treat the + * Store operation as a CopyObject". + */ + Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } - Status = AcpiNsAttachObject (Node, SourceDesc, - SourceDesc->Common.Type); + Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type); + AcpiUtRemoveReference (NewDesc); break; }