diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-01-13 10:42:38 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-01-13 10:42:38 -0700 |
| commit | c5ee73f65b4c77fe08aa44b8611bf084ae700f24 (patch) | |
| tree | aca72ec5f4fe45695bf7eea6bb288ee2f3ef27e9 /src/type.zig | |
| parent | 9bf2bda68356212168a213141e0a21d9dab22655 (diff) | |
| download | zig-c5ee73f65b4c77fe08aa44b8611bf084ae700f24.tar.gz zig-c5ee73f65b4c77fe08aa44b8611bf084ae700f24.zip | |
stage2: fix build on 32-bit ISAs
Fixes regression introduced in 93b854eb745ab3294054ae71150fe60f134f4d10.
Diffstat (limited to 'src/type.zig')
| -rw-r--r-- | src/type.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/type.zig b/src/type.zig index 40ce977711..b759a4bc34 100644 --- a/src/type.zig +++ b/src/type.zig @@ -3005,6 +3005,13 @@ pub const Type = extern union { return ty.arrayLen() + @boolToInt(ty.sentinel() != null); } + pub fn vectorLen(ty: Type) u32 { + return switch (ty.tag()) { + .vector => @intCast(u32, ty.castTag(.vector).?.data.len), + else => unreachable, + }; + } + /// Asserts the type is an array, pointer or vector. pub fn sentinel(self: Type) ?Value { return switch (self.tag()) { |
