diff options
| author | Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com> | 2023-11-27 15:35:29 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-27 12:35:29 +0000 |
| commit | 7fbbeae617ad9c30605a78377888c284e5d9ccdc (patch) | |
| tree | 3e56b1535d3930ff7cb621630c64008ceb42261d /src/value.zig | |
| parent | 89572c63424eb8d9da90f2676b55c660ece57688 (diff) | |
| download | zig-7fbbeae617ad9c30605a78377888c284e5d9ccdc.tar.gz zig-7fbbeae617ad9c30605a78377888c284e5d9ccdc.zip | |
value: handle lazy_align and lazy_size in writeToPackedMemory
Diffstat (limited to 'src/value.zig')
| -rw-r--r-- | src/value.zig | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/value.zig b/src/value.zig index f046b9ae3d..45f603ed2d 100644 --- a/src/value.zig +++ b/src/value.zig @@ -803,7 +803,14 @@ pub const Value = struct { switch (ip.indexToKey((try val.intFromEnum(ty, mod)).toIntern()).int.storage) { inline .u64, .i64 => |int| std.mem.writeVarPackedInt(buffer, bit_offset, bits, int, endian), .big_int => |bigint| bigint.writePackedTwosComplement(buffer, bit_offset, bits, endian), - else => unreachable, + .lazy_align => |lazy_align| { + const num = Type.fromInterned(lazy_align).abiAlignment(mod).toByteUnits(0); + std.mem.writeVarPackedInt(buffer, bit_offset, bits, num, endian); + }, + .lazy_size => |lazy_size| { + const num = Type.fromInterned(lazy_size).abiSize(mod); + std.mem.writeVarPackedInt(buffer, bit_offset, bits, num, endian); + }, } }, .Float => switch (ty.floatBits(target)) { |
