From 8587e510e46f98e321fbad30bb235e5eed33f1ba Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 7 May 2023 22:25:50 -0700 Subject: stage2: more InternPool related fixes * make Sema.zirPtrType coerce the sentinel value against the element type * fix lazyAbiAlignment wrong result type * typeHasOnePossibleValue no longer tries to create interned enum tag value with integer zero, instead uses enum_field_index * Type.ptr avoids trying to store typed null values into the intern pool --- src/value.zig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/value.zig') diff --git a/src/value.zig b/src/value.zig index 5372677543..855e769767 100644 --- a/src/value.zig +++ b/src/value.zig @@ -2637,6 +2637,14 @@ pub const Value = struct { } } + pub fn isLazyAlign(val: Value) bool { + return val.ip_index == .none and val.tag() == .lazy_align; + } + + pub fn isLazySize(val: Value) bool { + return val.ip_index == .none and val.tag() == .lazy_size; + } + pub fn isRuntimeValue(val: Value) bool { return val.ip_index == .none and val.tag() == .runtime_value; } -- cgit v1.2.3