aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ast/base.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ast/base.zig b/src/ast/base.zig
index f1877018c..0006b7315 100644
--- a/src/ast/base.zig
+++ b/src/ast/base.zig
@@ -34,10 +34,13 @@ pub const RefHashCtx = struct {
};
pub const Ref = packed struct {
+ const Padding = std.meta.Int(.unsigned, 64 - ((@bitSizeOf(Int) * 2) + 1));
+
source_index: Int = std.math.maxInt(Ref.Int),
inner_index: Int = 0,
is_source_contents_slice: bool = false,
+ _padding: Padding = 0,
// 2 bits of padding for whatever is the parent
pub const Int = u30;
pub const None = Ref{
@@ -93,3 +96,7 @@ pub inline fn debugl(
) void {
// Output.print("{s}\n", .{fmt});
}
+
+comptime {
+ if (@bitSizeOf(Ref) != 64) @compileError("Ref should be 64 bits exactly");
+}