zig icon indicating copy to clipboard operation
zig copied to clipboard

Getting location of vector component for non-power-of-two type is broken on stage2

Open silversquirl opened this issue 3 years ago • 0 comments

Zig Version

0.10.0-dev.3978+4fd4c733d

Steps to Reproduce

const std = @import("std");
pub fn main() !void {
    var x: std.meta.Vector(2, u15) = .{ 1, 4 };
    std.debug.print("{} {}\n", .{ (&x[0]).*, (&x[1]).* });
}

Expected Behavior

Output of 1 4

Actual Behavior

Output of 1 2, as the second integer is shifted down by 1 bit.

silversquirl avatar Sep 11 '22 10:09 silversquirl