diff --git a/libs/ast/source/type_check.cpp b/libs/ast/source/type_check.cpp index a73c2bc..038a721 100644 --- a/libs/ast/source/type_check.cpp +++ b/libs/ast/source/type_check.cpp @@ -535,6 +535,12 @@ namespace pslang::ast } } + if (types::equal(*source_type, types::primitive_type{types::u64_type{}}) && types::is_pointer_type(*target_type)) + return; + + if (types::equal(*target_type, types::primitive_type{types::u64_type{}}) && types::is_pointer_type(*source_type)) + return; + if (auto source_array_type = std::get_if(source_type.get())) { if (auto target_pointer_type = std::get_if(target_type.get())) diff --git a/libs/jit/source/arch/aarch64/compiler.cpp b/libs/jit/source/arch/aarch64/compiler.cpp index 2593ae8..e736afc 100644 --- a/libs/jit/source/arch/aarch64/compiler.cpp +++ b/libs/jit/source/arch/aarch64/compiler.cpp @@ -591,7 +591,14 @@ namespace pslang::jit::aarch64 auto src_type = node.arg1->inferred_type; auto dst_type = node.target_type; - if (types::equal(*src_type, *dst_type) || (types::is_pointer_type(*src_type) && types::is_pointer_type(*dst_type))) + auto u64_type = types::primitive_type{types::u64_type{}}; + + if (false + || (types::is_builtin_type(*src_type) && types::equal(*src_type, *dst_type)) + || (types::is_pointer_type(*src_type) && types::is_pointer_type(*dst_type)) + || (types::equal(*src_type, u64_type) && types::is_pointer_type(*dst_type)) + || (types::equal(*dst_type, u64_type) && types::is_pointer_type(*src_type)) + ) { load(node.arg1, 0); store(it, 0);