Kernel: Fix AML Register/Reference accesses
This commit is contained in:
parent
eaf06d239c
commit
4dc107f77a
|
@ -69,9 +69,12 @@ namespace Kernel::ACPI::AML
|
|||
if (!parse_result.success())
|
||||
return ParseResult::Failure;
|
||||
object = parse_result.node();
|
||||
}
|
||||
|
||||
if (object && object->type == AML::Node::Type::Reference)
|
||||
object = static_cast<AML::Reference*>(object.ptr())->node;
|
||||
if (object && object->type == AML::Node::Type::Register)
|
||||
object = static_cast<AML::Register*>(object.ptr())->value;
|
||||
}
|
||||
|
||||
if (!conditional)
|
||||
{
|
||||
|
|
|
@ -22,6 +22,8 @@ namespace Kernel::ACPI::AML
|
|||
if (!object_result.success())
|
||||
return ParseResult::Failure;
|
||||
auto object_node = object_result.node();
|
||||
if (object_node && object_node->type == AML::Node::Type::Register)
|
||||
object_node = static_cast<AML::Register*>(object_node.ptr())->value;
|
||||
if (!object_node)
|
||||
{
|
||||
AML_ERROR("SizeOf object is null");
|
||||
|
|
|
@ -44,9 +44,9 @@ namespace Kernel::ACPI::AML
|
|||
AML_DEBUG_PRINTLN("}");
|
||||
#endif
|
||||
|
||||
if (!destination->store(source))
|
||||
if (auto stored = destination->store(source))
|
||||
return ParseResult(stored);
|
||||
return ParseResult::Failure;
|
||||
return ParseResult(destination);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue