diff --git a/kernel/include/kernel/ACPI/AML/Reference.h b/kernel/include/kernel/ACPI/AML/Reference.h index dfe2b4beca..56a32a1862 100644 --- a/kernel/include/kernel/ACPI/AML/Reference.h +++ b/kernel/include/kernel/ACPI/AML/Reference.h @@ -69,10 +69,13 @@ namespace Kernel::ACPI::AML if (!parse_result.success()) return ParseResult::Failure; object = parse_result.node(); - if (object && object->type == AML::Node::Type::Register) - object = static_cast(object.ptr())->value; } + if (object && object->type == AML::Node::Type::Reference) + object = static_cast(object.ptr())->node; + if (object && object->type == AML::Node::Type::Register) + object = static_cast(object.ptr())->value; + if (!conditional) { if (!object) diff --git a/kernel/include/kernel/ACPI/AML/SizeOf.h b/kernel/include/kernel/ACPI/AML/SizeOf.h index 828fad9691..d81bb099ff 100644 --- a/kernel/include/kernel/ACPI/AML/SizeOf.h +++ b/kernel/include/kernel/ACPI/AML/SizeOf.h @@ -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(object_node.ptr())->value; if (!object_node) { AML_ERROR("SizeOf object is null"); diff --git a/kernel/include/kernel/ACPI/AML/Store.h b/kernel/include/kernel/ACPI/AML/Store.h index 62fa30ac0c..c691f7574c 100644 --- a/kernel/include/kernel/ACPI/AML/Store.h +++ b/kernel/include/kernel/ACPI/AML/Store.h @@ -44,9 +44,9 @@ namespace Kernel::ACPI::AML AML_DEBUG_PRINTLN("}"); #endif - if (!destination->store(source)) - return ParseResult::Failure; - return ParseResult(destination); + if (auto stored = destination->store(source)) + return ParseResult(stored); + return ParseResult::Failure; } };