mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
cbe: fix comptime-known packed unions
This commit is contained in:
parent
a0d1682921
commit
592f1043dc
@ -2438,7 +2438,10 @@ pub const DeclGen = struct {
|
||||
const ty = val.typeOf(zcu);
|
||||
return .{ .data = .{
|
||||
.dg = dg,
|
||||
.int_info = ty.intInfo(zcu),
|
||||
.int_info = if (ty.zigTypeTag(zcu) == .@"union" and ty.containerLayout(zcu) == .@"packed")
|
||||
.{ .signedness = .unsigned, .bits = @intCast(ty.bitSize(zcu)) }
|
||||
else
|
||||
ty.intInfo(zcu),
|
||||
.kind = kind,
|
||||
.ctype = try dg.ctypeFromType(ty, kind),
|
||||
.val = val,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user