cbe: add missing cast for @intToPtr values

This commit is contained in:
Jacob Young
2023-06-15 01:30:06 -04:00
committed by Andrew Kelley
parent 1253d591be
commit 2d6d2a1d11
2 changed files with 9 additions and 5 deletions

View File

@@ -596,9 +596,11 @@ pub const DeclGen = struct {
},
location,
),
.int => |int| try writer.print("{x}", .{
try dg.fmtIntLiteral(Type.usize, int.toValue(), .Other),
}),
.int => |int| {
try writer.writeByte('(');
try dg.renderCType(writer, ptr_cty);
try writer.print("){x}", .{try dg.fmtIntLiteral(Type.usize, int.toValue(), .Other)});
},
.eu_payload, .opt_payload => |base| {
const ptr_base_ty = mod.intern_pool.typeOf(base).toType();
const base_ty = ptr_base_ty.childType(mod);