Merge pull request #7319 from corleypc/f32-to-u64-fix

Fixes f32 to 64-bit int/uint conversion
This commit is contained in:
Jeroen van Rijn
2026-08-12 15:22:17 +02:00
committed by GitHub

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;