Fix address of operator in IR compiler

This commit is contained in:
Nikita Lisitsa 2026-03-31 13:07:28 +03:00
parent 0784e27a01
commit fefe741b16

View file

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