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.
This commit is contained in:
Robert Moore 2012-12-07 14:13:01 -08:00
parent aa3b6824ac
commit d7d9d66bf6

View File

@ -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;
}