fixes f32 to 64-bit int/uint conversion

This commit is contained in:
Mihail Moskov
2026-08-12 16:02:49 +03:00
parent 3dc7016a4e
commit 6dda0198f0

View File

@@ -2546,7 +2546,9 @@ gb_internal lbValue lb_emit_conv(lbProcedure *p, lbValue value, Type *t) {
lbValue res_i128 = lb_emit_runtime_call(p, call, args);
return lb_emit_conv(p, res_i128, t);
}
i64 sz = type_size_of(src);
// the intermediate int must be at least as wide as the dest,
// otherwise e.g. f32 -> u64 truncates through a 32-bit fptoui
i64 sz = gb_max(type_size_of(src), type_size_of(dst));
lbValue res = {};
res.type = t;