Fix address of operator in IR compiler
This commit is contained in:
parent
0784e27a01
commit
fefe741b16
1 changed files with 7 additions and 0 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue