| author | |
| committer | |
| log | 2d6d2a1d11bfca780e559303904571a93bace86b |
| tree | fcc7005ea3911834e61407f65a41a483e556ec47 |
| parent | 1253d591be2aeea49c0b67ce0416237060e78a57 |
2 files changed, 9 insertions(+), 5 deletions(-)
src/TypedValue.zig+4-2| ... | ... | @@ -345,12 +345,13 @@ pub fn print( |
| 345 | 345 | try writer.print("[{}]", .{elem.index}); |
| 346 | 346 | }, |
| 347 | 347 | .field => |field| { |
| 348 | const container_ty = ip.typeOf(field.base).toType(); | |
| 348 | const ptr_container_ty = ip.typeOf(field.base).toType(); | |
| 349 | 349 | try print(.{ |
| 350 | .ty = container_ty, | |
| 350 | .ty = ptr_container_ty, | |
| 351 | 351 | .val = field.base.toValue(), |
| 352 | 352 | }, writer, level - 1, mod); |
| 353 | 353 | |
| 354 | const container_ty = ptr_container_ty.childType(mod); | |
| 354 | 355 | switch (container_ty.zigTypeTag(mod)) { |
| 355 | 356 | .Struct => { |
| 356 | 357 | if (container_ty.isTuple(mod)) { |
| ... | ... | @@ -375,6 +376,7 @@ pub fn print( |
| 375 | 376 | } |
| 376 | 377 | }, |
| 377 | 378 | } |
| 379 | return; | |
| 378 | 380 | }, |
| 379 | 381 | .opt => |opt| switch (opt.val) { |
| 380 | 382 | .none => return writer.writeAll("null"), |
src/codegen/c.zig+5-3| ... | ... | @@ -596,9 +596,11 @@ pub const DeclGen = struct { |
| 596 | 596 | }, |
| 597 | 597 | location, |
| 598 | 598 | ), |
| 599 | .int => |int| try writer.print("{x}", .{ | |
| 600 | try dg.fmtIntLiteral(Type.usize, int.toValue(), .Other), | |
| 601 | }), | |
| 599 | .int => |int| { | |
| 600 | try writer.writeByte('('); | |
| 601 | try dg.renderCType(writer, ptr_cty); | |
| 602 | try writer.print("){x}", .{try dg.fmtIntLiteral(Type.usize, int.toValue(), .Other)}); | |
| 603 | }, | |
| 602 | 604 | .eu_payload, .opt_payload => |base| { |
| 603 | 605 | const ptr_base_ty = mod.intern_pool.typeOf(base).toType(); |
| 604 | 606 | const base_ty = ptr_base_ty.childType(mod); |