mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
cbe: add missing cast for @intToPtr values
This commit is contained in:
parent
1253d591be
commit
2d6d2a1d11
@ -345,12 +345,13 @@ pub fn print(
|
||||
try writer.print("[{}]", .{elem.index});
|
||||
},
|
||||
.field => |field| {
|
||||
const container_ty = ip.typeOf(field.base).toType();
|
||||
const ptr_container_ty = ip.typeOf(field.base).toType();
|
||||
try print(.{
|
||||
.ty = container_ty,
|
||||
.ty = ptr_container_ty,
|
||||
.val = field.base.toValue(),
|
||||
}, writer, level - 1, mod);
|
||||
|
||||
const container_ty = ptr_container_ty.childType(mod);
|
||||
switch (container_ty.zigTypeTag(mod)) {
|
||||
.Struct => {
|
||||
if (container_ty.isTuple(mod)) {
|
||||
@ -375,6 +376,7 @@ pub fn print(
|
||||
}
|
||||
},
|
||||
}
|
||||
return;
|
||||
},
|
||||
.opt => |opt| switch (opt.val) {
|
||||
.none => return writer.writeAll("null"),
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user