From fefe741b160f4c7b4eb9bce704c431ccc4118143 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Tue, 31 Mar 2026 13:07:28 +0300 Subject: [PATCH] Fix address of operator in IR compiler --- libs/ir/source/compiler.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/ir/source/compiler.cpp b/libs/ir/source/compiler.cpp index 4b77e15..3009d00 100644 --- a/libs/ir/source/compiler.cpp +++ b/libs/ir/source/compiler.cpp @@ -124,6 +124,13 @@ namespace pslang::ir return last(); } + if (node.type == ast::unary_operation_type::address_of || node.type == ast::unary_operation_type::mutable_address_of) + { + if (auto result = apply_get_address(node.arg1)) + return *result; + throw std::runtime_error("Error compiling address of operator"); + } + mcontext.nodes->emplace_back(unary_operation{node.type, arg1}, node.inferred_type); return last(); }