aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-07-03 15:59:54 -0700
committerGitHub <noreply@github.com>2023-07-03 15:59:54 -0700
commit17890f6b8a9a91c780377ac6cdcb22fc4180e929 (patch)
tree330dae6f9a9c23e052e270c8cf333c5f80beded6 /src
parent0dffab7356685c7643aa6e3cbe0ad1a18bc0dd55 (diff)
parentadf07183165eb910be6f8b13ae0192dab6ed59e7 (diff)
downloadzig-17890f6b8a9a91c780377ac6cdcb22fc4180e929.tar.gz
zig-17890f6b8a9a91c780377ac6cdcb22fc4180e929.zip
Merge pull request #15879 from r00ster91/more_stage1_test_coverage
More stage1 test coverage
Diffstat (limited to 'src')
-rw-r--r--src/value.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/value.zig b/src/value.zig
index 774b5806b8..d8536ef2a6 100644
--- a/src/value.zig
+++ b/src/value.zig
@@ -616,7 +616,7 @@ pub const Value = struct {
.Int, .Enum => {
const int_info = ty.intInfo(mod);
const bits = int_info.bits;
- const byte_count = (bits + 7) / 8;
+ const byte_count: u16 = @intCast((@as(u17, bits) + 7) / 8);
var bigint_buffer: BigIntSpace = undefined;
const bigint = val.toBigInt(&bigint_buffer, mod);
@@ -859,7 +859,7 @@ pub const Value = struct {
};
const int_info = int_ty.intInfo(mod);
const bits = int_info.bits;
- const byte_count = (bits + 7) / 8;
+ const byte_count: u16 = @intCast((@as(u17, bits) + 7) / 8);
if (bits == 0 or buffer.len == 0) return mod.getCoerced(try mod.intValue(int_ty, 0), ty);
if (bits <= 64) switch (int_info.signedness) { // Fast path for integers <= u64