Allow uintptr <-> [^]T

This commit is contained in:
gingerBill
2021-09-29 16:36:05 +01:00
parent 19ac822e4a
commit f99bea12c7

View File

@@ -1272,6 +1272,18 @@ lbValue lb_emit_conv(lbProcedure *p, lbValue value, Type *t) {
res.value = LLVMBuildIntToPtr(p->builder, value.value, lb_type(m, t), "");
return res;
}
if (is_type_multi_pointer(src) && is_type_uintptr(dst)) {
lbValue res = {};
res.type = t;
res.value = LLVMBuildPtrToInt(p->builder, value.value, lb_type(m, t), "");
return res;
}
if (is_type_uintptr(src) && is_type_multi_pointer(dst)) {
lbValue res = {};
res.type = t;
res.value = LLVMBuildIntToPtr(p->builder, value.value, lb_type(m, t), "");
return res;
}
#if 1
if (is_type_union(dst)) {